There is a system date format, based on the user's OS preferences, for displaying dates. E.g. in Europe the date is typically displayed DD/MM/YYYY, whereas in the U.S. it's MM/DD/YYYY ... it would be nice if there was a way to retrieve this format and/or have the data automatically formatted based on the user's regional preferences ... for both dates and times.
Perhaps as a set of Masks in the FormatDate() command?
e.g.
%SystemDateFormat
%SystemTimeFormat
would display the date or time in the format appropriate to the user's settings. I'm sure Fred could come up with a better solution!
System date format
Re: System date format
I just found this post and here's a quick-and-dirty hack, just to point you in
the right direction. It's your responsibility to clean it up and make it work in
all situations.
the right direction. It's your responsibility to clean it up and make it work in
all situations.

Code: Select all
shortdate$=Space(10) : GetLocaleInfo_(#LOCALE_USER_DEFAULT,#LOCALE_SSHORTDATE,shortdate$,10)
Debug shortdate$
a$=ReplaceString(shortdate$,"/","/%")
a$=ReplaceString(a$,"d","%dd")
Debug FormatDate(a$,Date())
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.