Page 1 of 1

dateFormat # symbols

Posted: Fri Apr 25, 2014 2:21 pm
by Ledigimate
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

Re: dateFormat # symbols

Posted: Fri Apr 25, 2014 3:06 pm
by FourthWorld
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

Re: dateFormat # symbols

Posted: Fri Apr 25, 2014 5:03 pm
by FourthWorld
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.

Re: dateFormat # symbols

Posted: Mon Apr 28, 2014 6:11 pm
by Ledigimate
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 %)