system date format

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

pderocco
Posts: 44
Joined: Fri May 16, 2008 1:26 am

system date format

Post by pderocco » Fri Sep 21, 2018 11:33 pm

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.
Ciao,
Paul

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: system date format

Post by richmond62 » Mon Sep 24, 2018 9:25 am

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

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: system date format

Post by Klaus » Mon Sep 24, 2018 12:04 pm

This is definitively no bug, so I will move this thread to the beginners section!

AxWald
Posts: 578
Joined: Thu Mar 06, 2014 2:57 pm

Re: system date format

Post by AxWald » Mon Sep 24, 2018 12:05 pm

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!
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: system date format

Post by dunbarx » Mon Sep 24, 2018 2:31 pm

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: system date format

Post by richmond62 » Mon Sep 24, 2018 4:45 pm

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)

pderocco
Posts: 44
Joined: Fri May 16, 2008 1:26 am

Re: system date format

Post by pderocco » Mon Sep 24, 2018 5:11 pm

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.
Ciao,
Paul

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: system date format

Post by dunbarx » Mon Sep 24, 2018 10:52 pm

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

SparkOut
Posts: 2834
Joined: Sun Sep 23, 2007 4:58 pm

Re: system date format

Post by SparkOut » Tue Sep 25, 2018 6:37 am

What about when the year is before 1970?

(Yeah, it's a problem on Windows)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: system date format

Post by dunbarx » Tue Sep 25, 2018 4:49 pm

You may want to look at this thread:

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

Craig

SparkOut
Posts: 2834
Joined: Sun Sep 23, 2007 4:58 pm

Re: system date format

Post by SparkOut » Tue Sep 25, 2018 9:03 pm

It doesn't help Windows users. LiveCode on Windows thinks a date before 1970 "is not a date" or errors.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: system date format

Post by dunbarx » Tue Sep 25, 2018 9:37 pm

Nothing can ever help Windows users. 8)

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: system date format

Post by FourthWorld » Tue Sep 25, 2018 10:20 pm

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

:)
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

SparkOut
Posts: 2834
Joined: Sun Sep 23, 2007 4:58 pm

Re: system date format

Post by SparkOut » Wed Sep 26, 2018 4:38 am

Banter aside, does really nobody care about Windows?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: system date format

Post by FourthWorld » Wed Sep 26, 2018 5:36 am

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. ;)
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”