AddTimeToDate (open)

Adds a time to a date, and returns the new timestamp

Syntax

LOADLIB "wh::datetime.whlib";

DATETIME FUNCTION AddTimeToDate(INTEGER64 add_msecs, DATETIME date)

Parameters

INTEGER64 add_msecs

The number of milliseconds to add to the timestamp

DATETIME date

The timestamp to add the time to

Return value

DATETIME

A DateTime value representing @italic date to which @italic add_msecs has been added

Description

This function can for example be useful to calculate the time in different time zones.

Examples

// returns a timestamp of the current date and time in UTC + 1 hour
INTEGER extra := 60 * 60 * 1000;
DATETIME utc_plus_1 := AddTimeToDate(extra, GetCurrentDateTime());