Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning to [ls]dateTimeFormat() to inform about the mask usage #266

Closed
mjhagen opened this issue Jan 11, 2016 · 5 comments
Closed

Add warning to [ls]dateTimeFormat() to inform about the mask usage #266

mjhagen opened this issue Jan 11, 2016 · 5 comments

Comments

@mjhagen
Copy link
Contributor

mjhagen commented Jan 11, 2016

As discovered by Alexander Kwaschny in https://bugbase.adobe.com/index.cfm?event=bug&id=4105828 uppercase "Y" is different from lowercase "y" the Adobe docs don't mention this explicitly but they do say that the function also follows Java date time mask. Unfortunately they link to a java 6 doc where uppercase "Y" wasn't used yet.

@pfreitag
Copy link
Member

Thanks for pointing this out... do you know off hand if this applies to dateFormat as well?

@mjhagen
Copy link
Contributor Author

mjhagen commented Jan 11, 2016

I don't think it does, while testing it I originally couldn't reproduce and noticed I was testing dateFormat() instead of dateTimeFormat().

@pfreitag
Copy link
Member

Thanks - will be interesting to see if Adobe has an opinion on it how it should work.

@shawnoden
Copy link
Contributor

I tested a few of the date functions that take a mask. dateAdd() and datePart() don't see a difference in "y" or "Y". dateFormat() doesn't change with "y" or "Y" but does change with "s" and "S". timeFormat() reads "s" and "S" as the same mask, but sees "d" and "D" different. Though since both of those are only supposed to deal with their respective date parts, I guess I can't complain too much. However, dateTimeFormat() does see differences in "d" and "D", "y" and "Y" (as stated), "h" and "H", and "k" and "K". I haven't dug much further into CF date masking, but I may need to. This may be one of those things that I forgot I knew, but being in SQL land so long, I've gotten used to somewhat sensible date masks.

@shawnoden
Copy link
Contributor

Oh, and Lucee can get very odd with date masking.

http://trycf.com/gist/0521ba783c8d220bc888/lucee?theme=monokai

Didn't Y'Y'Y'Y used to be old pre-MX behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants