From 163efa19648c08ec6ee2b5e08fdc5b23ec0ce747 Mon Sep 17 00:00:00 2001 From: John Zwinck Date: Sat, 2 Mar 2013 09:14:11 +0800 Subject: [PATCH] Readme: add examples using specific dates instead of "now" --- Readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Readme.md b/Readme.md index ba50613..a6d3673 100644 --- a/Readme.md +++ b/Readme.md @@ -17,6 +17,8 @@ Usage var strftime = require('strftime') 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: @@ -34,6 +36,7 @@ If you want to localize it: 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', 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: