Skip to content

Commit

Permalink
Merge pull request #20 from jzwinck/patch-1
Browse files Browse the repository at this point in the history
Readme: add examples using specific dates instead of "now"
  • Loading branch information
samsonjs committed Mar 2, 2013
2 parents 4bcd6d2 + 163efa1 commit 5a051ac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Readme.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Usage


var strftime = require('strftime') var strftime = require('strftime')
console.log(strftime('%B %d, %y %H:%M:%S')) // => April 28, 2011 18:21:08 console.log(strftime('%B %d, %y %H:%M:%S')) // => April 28, 2011 18:21:08
console.log(strftime('%F %T', new Date(1307472705067))) // => 2011-06-07 18:51:45



If you want to localize it: If you want to localize it:


Expand All @@ -34,6 +36,7 @@ If you want to localize it:
PM: 'PM' PM: 'PM'
} }
console.log(strftime('%B %d, %y %H:%M:%S', it_IT)) // => aprile 28, 2011 18:21:08 console.log(strftime('%B %d, %y %H:%M:%S', it_IT)) // => aprile 28, 2011 18:21:08
console.log(strftime('%B %d, %y %H:%M:%S', new Date(1307472705067), it_IT)) // => giugno 7, 2011 18:51:45


And if you don't want to pass a localization object every time you can get a localized `strftime` function like so: And if you don't want to pass a localization object every time you can get a localized `strftime` function like so:


Expand Down

0 comments on commit 5a051ac

Please sign in to comment.