Method - How to Retrieve Date and Time Formats?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Method - How to Retrieve Date and Time Formats?

Post 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'
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Marco
Posts: 2347
Joined: 27 Jun 2011 15:20

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

Post 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...
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

LittleBiG
Posts: 1846
Joined: 08 Apr 2011 12:57
Location: Win10x64

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

Post 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");

admin
Site Admin
Posts: 60602
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

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

Post 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...

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

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

Post 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.



.

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

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

Post by SkyFrontier »

Thanks for all the tips, people! Very much!
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Post Reply