Page 1 of 1

Method - How to Retrieve Date and Time Formats?

Posted: 13 Mar 2014 05:00
by SkyFrontier
Fine.

text formatdate(, "yyyy-mm-dd, hhnnss");
gives me
2014-03-13, 005417

-but how do I get the opposite, ie, retrieve what are the current format and separators from a system according to regional settings?
I'm doing it the hardest way possible with a very complicated algorithm to guess what is what, but there should be an easier way.

By the way,
text formatdate(, "yyyy-mm-dd, hh" . 'h' . "nn" . 'm' . "ss" . 's'); // last time I checked single quotes should NOT resolve but in this case they are - no idea why...
// pops '2014-03-13, 0005431717' instead of '2014-03-13, 00h54m17s'

Re: Method - How to Retrieve Date and Time Formats?

Posted: 13 Mar 2014 09:27
by Marco
I remember, but I could be wrong, something along the lines of <get something> for retrieving the decimal separator, but looks like its undocumented and can't find any reference on the forum...

Re: Method - How to Retrieve Date and Time Formats?

Posted: 13 Mar 2014 10:20
by LittleBiG
SkyFrontier wrote:By the way,
text formatdate(, "yyyy-mm-dd, hh" . 'h' . "nn" . 'm' . "ss" . 's'); // last time I checked single quotes should NOT resolve but in this case they are - no idea why...
// pops '2014-03-13, 0005431717' instead of '2014-03-13, 00h54m17s'
text formatdate(, "yyyy-mm-dd, hh\hnn\mss\s");

Re: Method - How to Retrieve Date and Time Formats?

Posted: 13 Mar 2014 10:22
by admin
// Decimal Separator:
echo get("locale", 14);

LOCALE_SDECIMAL = 14
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

You got to find a list of those value in the net...

Re: Method - How to Retrieve Date and Time Formats?

Posted: 13 Mar 2014 13:10
by Stefan
SkyFrontier wrote:-but how do I ... retrieve what are the current format and separators from a system according to regional settings?
See Proof of concept script over there >>> http://www.xyplorer.com/xyfc/viewtopic. ... 227#p96227 , down at the Status Quo line.



.

Re: Method - How to Retrieve Date and Time Formats?

Posted: 13 Mar 2014 14:46
by SkyFrontier
Thanks for all the tips, people! Very much!