Good evening group.
Maybe I’m getting lost again … I have problems managing dates with NIL values and understanding if a SQL date is valid.
Example, if the examined date is NIL or 32/12/2025?
For the one in the Italian format, I use ParseDate which works, but for the SQL one?
AlbertoD
(AlbertoD)
January 6, 2025, 10:50pm
2
What does it mean ‘which works’?
Basically you get True if is valid and False if not? If so, you can use Try-Catch and DateTime.FromString
AlbertoD:
What does it mean ‘which works’?
Basically you get True if is valid and False if not? If so, you can use Try-Catch and DateTime.FromString
It works for date in dd/mm/YYYY format, but what about date in YYYY/mm/dd format?
AlbertoD
(AlbertoD)
January 6, 2025, 11:13pm
4
Federico Giannetti:
It works
What do you get? A boolean? Do you want a boolean too?
How your code looks with ParseDate?
Federico Giannetti:
YYYY/mm/dd format?
I guess you mean YYYY-MM-DD
something like
//set boolean to true
try
//code to test the date using .FromString("YYYY-MM-DD")
Catch
//boolean to false
end try
If you want , yon can use my class
dateTime.xojo_binary_project.zip (12.6 KB)
JLP
Sory, latest version
sourceDateTime.zip (20.1 KB)
Ok thanks, and what if by chance the passed data was =“” or =NIL? how is it handled?