Hi
"the date" - will get you today's date
but that will return "03/30/15" for me today (30th of March 2015) the American English Format
so I need the system date which will pass back the date in the User's home country format (i.e. what is setup in the regional settings)
So putting "30/03/2015" into dd
put dd = (the system date) ==> true
The function for "the date" is date() but I don't know if their are any parameters to get it to pass the system date
so :-
put dd = date() ===> false
but ..
set UseSystemDate to true
put dd = date() ===> true
One thing to notice is that "the date" or date() passes back a 4 digit year in the date and the test
seems to be a string not a date test because if dd = "30/03/15" the test fails
Anybody with a better grasp care to help here?
If it's any use here is my library routine that I use for these sorts of things
Code: Select all
-- Function : DatesCompare()
-- Remarks : if Date 1 is Before Date 2 then return -1 , if same Return 0 else 1
-- : Follows Javascript DateObject return Values
-- Params : {date} pdDate1, pDate2
-- Returns : {Integer) - -1, 0 or 1
Function DatesCompare pDate1, Pdate2
set the usesystemdate to true
if pDate1 is not a date or pDate2 is not a date then return "NaN"
convert pDate1 to Dateitems
convert pDate2 to DateItems
-- These are inline with the JavasCript DateObject (and why not?)
if pDate1 < pDate2 then return -1
if pDate1 = pDate2 then return 0
if pDate1 > pDate2 then return 1
end DatesCompare
Regards Lagi