There are dozens of examples of 'How to' do lots of things with the 'Date' and 'Convert' functions but no matter how hard I try I fail to make the following idea work :
I need a date entry to be in the following format "DD/MM/YYYY" so that I can verify its range etc and continue with it in my script...
I thought I'd use the 'Convert [myDateVariable] to [short system date]' to ensure that, at least, the format of the entry was correct before I started checking day(DD), month(MM) and year(YYYY) components for validity...
So, I thought...
Code: Select all
local dMyDate, dToday
put "19/01/13" into dMyDate --dMyDate now contains "19/01/13"
put the short system date into dToday --dToday now contains "19/01/2012"
convert dMyDate to short system date --dMyDate still contains "19/01/13" WHEREAS I THOUGHT IT WOULD CONTAIN "19/01/2013"
--i.e. I THOUGHT the Year format would have been modified from my entered YY to YYYY
In fact, to add to my confusion, I often seem to end up (after the 'Convert') with the first two fileds (DD / MM) inverted by the 'Convert'...

I'm failing to make the 'convert' function as I thought it would... What am I doing wrong please ?
TIA
Regards.