Quantcast
Channel: coldfusion – Chris Tierney
Viewing all articles
Browse latest Browse all 14

DateFormat() Add Day Shortcut

$
0
0

I ran into some old code that adds 7 days to a date and spits it out in a DateFormat().

Normally you’d do this:

dateFormat( dateAdd( 'd', 7, now() ), 'mm/dd/yyyy' );

But the code I ran into doesn’t use the dateAdd() method. It just simply adds days.

dateFormat( now() + 7, 'mm/dd/yyyy' );

Though I can’t find this shortcut documented anywhere it seems to be working well with at least ColdFusion v8 and v9.



Viewing all articles
Browse latest Browse all 14

Latest Images

Trending Articles





Latest Images