PARSEDATE

Returns the date value of the object passed to the function. If the time is not included in the value, the function returns the time as 12:00:00 AM.

Syntax

= PARSEDATE(value)

Parameters

value

A value whose date value is to be determined. The value can contain DateTime as a string (e.g. “02/19/2009 14:30:30.3”, "2009-02-19 14:30:30.3", "19 Feb 2009 2:30:30.3 PM ", "Thu, 19 Feb 2009”) or as a DateTime object.

Return Type

DateTime

Examples

Example

Returns

= PARSEDATE(“02/19/2009 14:30:30.3”)

2/19/2009 2:30:30 PM

= PARSEDATE("2009-02-19 14:30:30.3")

2/19/2009 2:30:30 PM

= PARSEDATE(“19 Feb 2009”)

2/19/2009 12:00:00 AM

= PARSEDATE(ShippedDate)

The hours extracted from the value of ShippedDate. If any entries are NULL then returns date as 1/1/0001 12:00:00 AM.

= PARSEDATE(“abcd”)

Displays message “ERROR: The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.”