pf » DateFormat, and TimeFormat mask shortcuts
August 09, 2005
DateFormat, and TimeFormat mask shortcuts
Did you know that there were some date/time mask shortcuts for the DateFormat, and TimeFormat functions? They were added in ColdFusion MX 6.0, and they flew under the radar for many. I have seen them in the docs when I lookup a mask, but I always forget about them. The masks are short, medium, large, and full.
For Example:
short: #DateFormat(Now(), "short")# #TimeFormat(Now(), "short")# medium: #DateFormat(Now(), "medium")# #TimeFormat(Now(), "medium")# long: #DateFormat(Now(), "long")# #TimeFormat(Now(), "long")# full: #DateFormat(Now(), "full")# #TimeFormat(Now(), "full")#
Will output:
short: 8/9/05 3:09 PM medium: Aug 9, 2005 3:09:50 PM long: August 9, 2005 3:09:50 PM EDT full: Tuesday, August 9, 2005 3:09:50 PM EDT
PS - I have added a DateFormat CheatSheet to my collection of Cheet Sheets.
Related Entries
- Use CFSILENT - February 7, 2006
- How To Make a Tag Cloud - June 24, 2005
- Regular Expressions with ColdFusion - a Howto Guide - December 19, 2003
Trackback Address: 439/9211D9224C49A992CA646FEAFF15F6E7
Comments
On 08/09/2005 at 4:21:17 PM MDT PaulH wrote:
1
i use these religously. trying to parse a custom localized datestring back to a datetime object would often be impossible otherwise.
On 08/10/2005 at 8:35:21 AM MDT forgetfoo wrote:
2
niiiiiiiiice... just learned something new today, and i just got to work :)
On 01/15/2006 at 8:50:34 PM MST Andy wrote:
3
Thanks Pete...good to know.
- CFSCRIPT Cheatsheet
- 3 New Image Effects for ColdFusion 8
- Googlebot to Submit Web Forms
- ColdFusion 8 Update 1 Fixes some Image Processing Quirks
- 10 Most Useful Image Functions in ColdFusion 8
- Speaking at NYC CFUG This Week
- Adobe AIR Tutorial for HTML / JavaScript Developers
- INFORMATION_SCHEMA Support in MySQL, PostgreSQL
Subscribe to my RSS Feed:
RSS
RSS
add to del.icio.us
Pete Freitag is a software engineer, and web developer located in










