ToTimestamp
Converts a date or a date and time value into a timestamp.
Variants
- ToTimestamp(Date date)
- ToTimestamp(Date date, Time time)
- ToTimestamp(Date date, Time time, Text timezone)
ToTimestamp(Date date)
Returns a timestamp that corresponds to 12:00 am of the given date in the current user time zone (midnight at the beginning of the date).
Parameters
- date
- The date value you want to convert.
Returns
Timestamp
Examples
ToTimestamp([Date Column])takes the date value 4/30/2013 stored in the Date Column and returns the timestamp value 4/30/2013 12:00:00 AM in the current user’s time zone.
ToTimestamp(Date date, Time time)
Returns a timestamp that corresponds to the given time on the given date in the current user time zone.
Parameters
- date
- The date value you want to convert.
- time
- The time value you want to convert.
Returns
Timestamp
Examples
ToTimestamp([Date Column], [Time Column])takes the date value 4/30/2013 stored in the Date Column and the time value 10:20:00 AM stored in the Time Column, and returns the timestamp value 4/30/2013 10:20:00 AM in the current user’s time zone.ToTimestamp([Date Column], #09:00#)takes the date value stored in the Date Column and the time value 9:00 AM, and returns the corresponding timestamp value in the current user’s time zone.ToTimestamp([Date Column], ToTimeOfDay("20:00"))takes the date value stored in the Date Column, converts the te "20:00" to the time value 8:00 PM, and returns the corresponding timestamp value in the current user’s time zone.
ToTimestamp(Date date, Time time, Text timezone)
Returns a timestamp that corresponds to the given time on the given date in the specified time zone.
Parameters
- date
- The date value you want to convert.
- time
- The time value you want to convert.
- timezone
- The timezone date and time arguments provided in, out of the list of valid timezone identifiers.
Returns
Timestamp
Examples
ToTimestamp([Date Column], [Time Column], "America/New_York")takes the date value 4/30/2013 stored in the Date Column and the time value 10:20:00 AM stored in the Time Column in the timezone of New York, and returns the timestamp value 4/30/2013 2:20:00 PM UTC.