Use the function IsDateTime to check whether the number/string is right or not. If it is right, the function returns a DateTime value between 100-1-1 and 9999-12-31, otherwise the function returns null.
Parameters
Return value
DateTime value or null.
Examples
ToDateTime(255.35) - Returns 1900-09-12 08:23:59.ToDateTime("Jan 3, 2004") - Returns 2004-01-03 00:00:00.ToDateTime("5:25:26pm") - Returns 2004-02-23 17:25:26 because the current date is 2004-2-23.ToDateTime("2003-2-29 15:26:25") - Returns null because the given String value is not right DateTime value.ToDateTime("2004 *2 *29 15:26:25") - Returns null because the given String format is not right DateTime format.Returns a DateTime value.
Parameter
date - A Date value that can be converted to a DateTime type value by this function.
Example
ToDateTime(ToDate("2004-2-23")) - Returns 2004-02-23 00:00:00.
This function creates a TimeStamp value from arguments a and b.
Parameters
Return value
The return value is a DateTime.
Example
Suppose the date is July 15,1999 and the time is 12:20:30, the return value of the following statement is 1999-07-15 12:20:30.
ToDateTime(ToDate(1999, 7, 15), ToTime(12, 20, 30))
This function converts the argument d (A milliseconds value represents the number of milliseconds that have passed since January 1, 1970 00:00:00.000 GMT) to a TimeStamp value.
Parameter
d - A Milliseconds value, a DBField value or a parameter. It should be a long integer.
Return value
The return value is a DateTime.
Example
The return value of the following statement is 1970-01-02 04:00:00.
ToDateTime(72000000)
Notes:
This function creates a TimeStamp value from arguments y, m and d.
Parameters
Return value
The return value is a DateTime.
Example
Suppose the date is July 15,1999, the return value of the following statement is 1999-07-15 12:00:00.
ToDateTime(1999, 7, 15)
Note: In this function, because you only input year, month and day, the system will output 12:00:00 as the default time. Also you can decide the display format by selecting the format from the Report Inspector. The format of the example above is yyyy-mm-dd hh:mm:ss.
This function creates a TimeStamp value from arguments y, m, d, h, i and s.
Parameters
Return value
The return value is a DateTime.
Example
Suppose the date is July 15,1999 and time is 8:05:30, the return value of the following statement is 1999-07-15 08:05:30.
ToDateTime(1999, 7, 15, 8, 5, 30)