The DATEFROMSTRING function accepts a string representation of a date, a time, or both and converts the string to a numeric representation. Date and time are represented numerically as the number of seconds that have passed since January 1, 1970.
The DATEFROMSTRING function has the following format:
DATEFROMSTRING(date_time[, format_string])
The DATEFROMSTRING function accepts the following parameters:
date_time (string)
format_string (string)
(Optional) Specifies the format of date_time. For example, the format_string "YYYYMMDD" specifies the format of "20020223." If the format_string is omitted, the function uses the default format of "YYYYMMDDhhmmss." If date_time is invalid, the function returns -1.
The DATEFROMSTRING function returns a number.
Return_value=DATEFROMSTRING('20020223')
Return_value=1024804800
Copyright © 2010 CA. All rights reserved. | Email CA about this topic |