Partially Valid Dates

The documentation say that it does depend on your system locale.

use the GetAsDate or Date function to enter a date constant into a formula. The format of text date must be the same as the numeric date format on the system where the file was created.

Using the list of tests that you posted in GetAsText ( “” ) - #11 by xochi I was able to get valid dates from all the strings except the ones using spaces as delimiters. One of the strings you provided was "09_11_2001." In my locale Day("09_11_2001") returns 9.

What I have found in my experience with dates is that the safest way to generate a date is to use the Date function but you always have to be aware that the system locale will determine the output :

$date = "09_11_2001"
Date( Month ( $date ) ; Day ( $date ) ; Year ( $date ) )
-- depending on system locale the output will be
-- 9th November 2001
-- 11th September 2001 
2 Likes