samsonjs / strftime

strftime for JavaScript

Home Page:http://samhuri.net/projects/strftime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Off by a month

kenany opened this issue · comments

Might just be me being bad with dates?

var strftime = require('strftime');

var utcDate = new Date(1986, 8, 28, 15, 15);

strftime('%FT%TZ', utcDate);
// => '1986-09-28T15:15:00Z'

// expected: `1986-08-28T15:15:00Z`

Oh, my bad. For Date, the months start at index 0. strftime is right 😄

Yay JavaScript idiocy! 👏