The DATEVALUE function converts a text-formatted date to a datetime-formatted date.
DATEVALUE(
text
)
- text: Text string representing a date.
The DATEVALUE function returns a value in datetime format.
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.
In this example we convert the text string "1/7/2016" to a datetime type value:
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):