Description
Combines a date and a time value into a DateTime value.
Syntax
DateTime ( date {, time } )
Argument |
Description |
---|---|
date |
A valid date (such as Jan 1, 2005, or 12-31-99) or a blob variable whose first value is a date that you want included in the value returned by DateTime. |
time (optional) |
A valid time (such as 8am or 10:25:23:456799) or a blob variable whose first value is a time that you want included in the value returned by DateTime. If you include a time, only the hour portion is required. If you omit the minutes, seconds, or microseconds, they are assumed to be zeros. If you omit am or pm, the hour is determined according to the 24-hour clock. |
Return value
DateTime. Returns a DateTime value based on the values in date and optionally time. If time is omitted, DateTime uses 00:00:00.000000 (midnight).
Usage
To display microseconds in a time, the display format for the field must include microseconds.
For information on valid dates, see Date.
Examples
This expression returns the values in the order_date and order_time columns as a DateTime value that can be used to update the database:
DateTime(Order_Date, Order_Time)
Using this expression for a computed field displays 11/11/01 11:11:00:
DateTime(11/11/01, 11:11)
See also
DateTime in the section called “DateTime” in PowerScript Reference