Page 1 of 2

system date format

Posted: Fri Sep 21, 2018 11:33 pm
by pderocco
The "convert" command documents the "date" and "short date" formats as month/day/year, where the year is two digits. This is correct. The "system date" and "short system date" functions are documented the same way, but they actually produce a four-digit year.

If I had my druthers, "date" and "system date" would produce four-digit years, and "short date" and "short system date" would produce two-digit years.

Re: system date format

Posted: Mon Sep 24, 2018 9:25 am
by richmond62
druthers
That's an obscure word very few people outwith North America are going to understand.

It is bad enough having to put up with the FACT that LiveCode, while being made in Scotland, wants to cosy up to the North Americans by getting dates wrong!

Who ever heard of putting the month in front of the day? 8)

--------------

let's play games;

put the date gives me 9/24/18 [ which I would write 24/9/18 ]

put the system date
gives me .09.2018 which is to my mind, very odd.

convert the date to long english date
gives me Monday, September 24, 2018 which even I cannot object to.

I don't know where system date is documented . . . a search in the documentation produced dateFormat
The dateFormat function returns a string containing one or more formatting incantations, each of which describes a part of the requested date format. The possible incantations are as follows:

%a Abbreviated weekday name: the abbreviated day of the week, as reported by the weekdayNames function

%A Full weekday name: the full day of the week, as reported by the weekdayNames function

%b Abbreviated month name: the abbreviated month name, as reported by the monthNames function

%B Full month name: the full month name, as reported by the monthNames function

%d Day of the month: the day of the month as a number

%m Month number: the number of the month

%y Two-digit year: the year as a two-digit number

%Y Four-digit year: This incantation indicates the year as a four-digit number (including the century)

%w Day of the week: A number between 1 and 7
Which, if you think about things, means you can set the way dates work in almost any way you like.

And incantations has to go down on record as my favourite word in computer programming.
witch.png

Re: system date format

Posted: Mon Sep 24, 2018 12:04 pm
by Klaus
This is definitively no bug, so I will move this thread to the beginners section!

Re: system date format

Posted: Mon Sep 24, 2018 12:05 pm
by AxWald
Hi,
in my LC (6.7.10) the dictionary says (searching "date"):
Comments:
The format of the system date forms is set by the Date & Time control panel (on Mac OS systems), the Date control panel (on Windows systems), or the LANG environment variable (on Unix systems).
This may also solve the problem of the OP.

Have fun!

Re: system date format

Posted: Mon Sep 24, 2018 2:31 pm
by dunbarx
Richmond.
It is bad enough having to put up with the FACT that LiveCode, while being made in Scotland, wants to cosy up to the North Americans by getting dates wrong!
You fail to cozy up to the United States at your peril.

Craig

Re: system date format

Posted: Mon Sep 24, 2018 4:45 pm
by richmond62
You fail to cozy up to the United States at your peril.
The ONLY reason I might do that is that the thought of getting into the bed with the Russian Bear is far, far worse. 8)

Re: system date format

Posted: Mon Sep 24, 2018 5:11 pm
by pderocco
I see. Somewhere I saw an example of getting the current time using "system date", not realizing that "date" gets the current time and "system" modifies its format. Never mind.

Re: system date format

Posted: Mon Sep 24, 2018 10:52 pm
by dunbarx
Just so you know, it is possible to roll your own in any format using the "dateItems". There have been times when I needed to parse the information in special ways. It is easy to do, and you can keep each instance in a library somewhere.

Craig

Re: system date format

Posted: Tue Sep 25, 2018 6:37 am
by SparkOut
What about when the year is before 1970?

(Yeah, it's a problem on Windows)

Re: system date format

Posted: Tue Sep 25, 2018 4:49 pm
by dunbarx
You may want to look at this thread:

http://forums.livecode.com/viewtopic.ph ... ng#p138530

Craig

Re: system date format

Posted: Tue Sep 25, 2018 9:03 pm
by SparkOut
It doesn't help Windows users. LiveCode on Windows thinks a date before 1970 "is not a date" or errors.

Re: system date format

Posted: Tue Sep 25, 2018 9:37 pm
by dunbarx
Nothing can ever help Windows users. 8)

Craig

Re: system date format

Posted: Tue Sep 25, 2018 10:20 pm
by FourthWorld
dunbarx wrote:
Tue Sep 25, 2018 9:37 pm
Nothing can ever help Windows users. 8)
A free upgrade path is available:
https://www.ubuntu.com/download/desktop

:)

Re: system date format

Posted: Wed Sep 26, 2018 4:38 am
by SparkOut
Banter aside, does really nobody care about Windows?

Re: system date format

Posted: Wed Sep 26, 2018 5:36 am
by FourthWorld
SparkOut wrote:
Wed Sep 26, 2018 4:38 am
Banter aside, does really nobody care about Windows?
I use it for at least part of nearly every work day. After Android, it's three most popular platform in the world. And in terms of making money, Windows is arguably the most important platform LiveCode supports.

That said, in all my years in this industry I've never met anyone who truly loved it. I've met many who like it, but not with the sort of passion we often see with Mac and Linux fans.

Personally, I care about Windows a lot. I just don't care for it much. ;)