dateFormat # symbols

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Ledigimate
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 132
Joined: Mon Jan 14, 2013 3:37 pm

dateFormat # symbols

Post by Ledigimate » Fri Apr 25, 2014 2:21 pm

Hello

On my physical Android device, the dateFormat function returns
%#m/%#d/%Y
instead of
%m/%d/%Y

The dateFunction entry in the LiveCode dictionary mentions %a, %A, %b, %B, %d, %m, %y, %Y, and %w, but no #.
Can someone please tell me what the # symbol means in the return value of the dateFormat function?
Could it be a bug in LiveCode?

Thanks in advance,

Gerrie
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: dateFormat # symbols

Post by FourthWorld » Fri Apr 25, 2014 3:06 pm

When "#" is present for any of the elements of the dateFormat, the hash signifies that the value should always be represented as two digits; any single-digit numbers will be padded with a preceding zero.

For example, this dateFormat:
%d/%b/%y

...would yield:
4/4/44

And this date format:
#%d/#%b/%y

...would be represented as:
04/04/44


I've flagged this as a documentation bug, so others in the future can find this info right in the Dictionary entry for dateFormat:
http://quality.runrev.com/show_bug.cgi?id=12301
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: dateFormat # symbols

Post by FourthWorld » Fri Apr 25, 2014 5:03 pm

I goofed with my bug report, and it's a good lesson for all of us: the report I submitted for this was closed, marked as a duplicate of an earlier report:
http://quality.runrev.com/show_bug.cgi?id=11865

The lesson is that it's useful to report bugs as we find them, but before writing a new entry first use the Search feature there to see if an existing report has been filed for it.

I'll try to do better at that going forward, so the team doesn't waste their time handling multiple duplicates for a given issue.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Ledigimate
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 132
Joined: Mon Jan 14, 2013 3:37 pm

Re: dateFormat # symbols

Post by Ledigimate » Mon Apr 28, 2014 6:11 pm

Thank you, Richard!

So just to be sure, would a dateFormat of
#%m/#%d/%Y
mean the same thing as
%#m/%#d/%Y
?
(because your post has the # in front of the %, whereas my device has the # after the %)
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101

Post Reply