DATEVALUE

The DATEVALUE function converts a text-formatted date to a datetime-formatted date.

Syntax

DATEVALUE(
    text
)

Parameters
  • text: Text string representing a date.
Returned value

The DATEVALUE function returns a value in datetime format.

Additional Information

The DATEVALUE function uses the local date and time setting to interpret the string to convert. This means that if the local representation of a date has the form "day/month/year", the text string "7/5/2016" will be interpreted as July 5, 2016. On the contrary, if the local representation of a date has the form "month/day/year", this text string will be interpreted as May 7, 2016.

If the text string does not include year information, the year indicated by the system clock (the current year) will be used. If the text string contains information about a time, it is ignored.

The time included in the result is always 00:00:00.

Examples

In this example we convert the text string "1/7/2016" to a datetime type value:

DATEVALUE function. Example of use

In this second example we convert the text string "1/7" to a datetime type value. Notice how the information for the year is automatically added by extracting it from the system clock (2016):

DATEVALUE function. Example of use

Related functions
Category
Date and time
Submitted by admin on Mon, 12/03/2018 - 23:22