datetime() Function

Converts the given Date and Time into a serial number that holds the Date and Time data type.


datetime( year, month, day, [hour], [minute], [second] )

year: (Integer) The year of the you would like to convert into a serial number.

month: (Integer) Only numbers are accepted, not month names. Do not include leading zeroes for a month with one digit.

day: (Integer) The day of the Date and Time.

hour: (Integer) The hour of the Date and Time.

minute: (Integer) The minute of the Date and Time.

second: (Integer) The seconds of the Date and Time.


Date and Time


The value is converted to GMT when stored.


datetime(2011,2,28,12,0,0) returns 2/28/2011 7:00 AM EST

Appending a Time to a Date:

datetime(year(pv!yourDate), month(pv!yourdate), day(pv!yourDate), 23, 59, 00) returns 6/8/1984 7:59 PM EDT by adding the time 11:59 pm to a given date where pv!yourDate is 6/8/1984 and applying the timezone conversion.

See Also

userdatetime(): Use this function to return a Datetime value in the local time zone.

Open in Github Built: Mon, Nov 21, 2022 (02:00:00 PM)

On This Page