samsonjs/strftime

Incorrect example in Readme.md

tyleo opened this issue · 2 comments

tyleo commented

In Readme.md we have:

var strftime = require('strftime') // not required in browsers
var strftimePDT = strftime.timezone('-0700')
var strftimeCEST = strftime.timezone('+0200')
console.log(strftimePDT('%F %T', new Date(1307472705067))) // => June 07, 11 11:51:45
console.log(strftimeCEST('%F %T', new Date(1307472705067))) // => 2011-06-07 20:51:45

The %F %T specifier should not produce June 07, 11 11:51:45 on the 4th line. You should instead have 2011-06-07 11 11:51:45. Alternatively you might have meant to use the %B %d, %y %H:%M:%S specifier.

The %F specifier is locale dependent. Maybe it makes sense to use locale
independent specifiers in examples, maybe not :)
On Jun 19, 2015 9:58 PM, "Tyler Wolf Leonhardt" notifications@github.com
wrote:

In Readme.md we have:

var strftime = require('strftime') // not required in browsers
var strftimePDT = strftime.timezone('-0700')
var strftimeCEST = strftime.timezone('+0200')
console.log(strftimePDT('%F %T', new Date(1307472705067))) // => June 07, 11 11:51:45
console.log(strftimeCEST('%F %T', new Date(1307472705067))) // => 2011-06-07 20:51:45

The %F %T specifier should not produce June 07, 11 11:51:45 on the 4th
line. You should instead have 2011-06-07 11 11:51:45. Alternatively you
might have meant to use the %B %d, %y %H:%M:%S specifier.


Reply to this email directly or view it on GitHub
#66.

Thanks for catching this one @tyleo, that is a copy-paste mistake.

@alexandrnikitin Yeah maybe, maybe not :) For now I'll leave it in since it uses the default locale and that is what you will see if you try the code.