we have a global network so servers around the globe have different configurations. one of the most annoying issues when scripting for all of those servers is the datetime formatting.
some servers show 12/8/2010 1:30:00 PM
others 8/12/2010 13:30
Or 2010-12-08 13:30
what is the best solution to have reliable time calculations around the globe with one script ?
because sometimes 12/8 is interpeted as 8 December and sometimes as 12 August.
how can I script in a way which will work around the globe and prevent incorrect date interpetations ?
I am now trying to resolve it by using :
setlocale("en-gb")
T = formatdatetime(now,vbLongDate) & " " & Formatdatetime(now,vbLongTime)
which results in
T = 8 December 2010 13:30:00
which I store in a registry key.
another script that is accessing this value also uses the setlocale("en-gb")
hopefully the datediff can then only produce one answer
But I have run into issues with datetime formatting before.
So I would like to hear what other people do to overcome ambiguous answers when testing on dates
some servers show 12/8/2010 1:30:00 PM
others 8/12/2010 13:30
Or 2010-12-08 13:30
what is the best solution to have reliable time calculations around the globe with one script ?
because sometimes 12/8 is interpeted as 8 December and sometimes as 12 August.
how can I script in a way which will work around the globe and prevent incorrect date interpetations ?
I am now trying to resolve it by using :
setlocale("en-gb")
T = formatdatetime(now,vbLongDate) & " " & Formatdatetime(now,vbLongTime)
which results in
T = 8 December 2010 13:30:00
which I store in a registry key.
another script that is accessing this value also uses the setlocale("en-gb")
hopefully the datediff can then only produce one answer
But I have run into issues with datetime formatting before.
So I would like to hear what other people do to overcome ambiguous answers when testing on dates