Date-fns: format in nodeJS buggy?

Created on 25 Mar 2018  ·  1Comment  ·  Source: date-fns/date-fns

Hi there,

I may be missing some fundamental thing, but somehow this is happening right now when using format in nodeJS:

new Date()
// => Sun Mar 25 2018 14:56:07 GMT+0200 (CEST)

format(new Date(), 'YYYY-MM-YY');
// => 2018-03-18

The format date is the 18th since 3 days (the time I'm trying to debug this). Which is even more weird to me.
I'm using node 9.6.1. This happens when the application runs on a server as well as on my local machine.
I'm not sure what to do here 🤔 do I pass the date to format in the wrong way?

Most helpful comment

posting it here showed me what I did wrong. YY... I'm such an idiot 🤦‍♂️ sorry
3 days wasted

>All comments

posting it here showed me what I did wrong. YY... I'm such an idiot 🤦‍♂️ sorry
3 days wasted

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ahtcx picture ahtcx  ·  3Comments

mnquintana picture mnquintana  ·  3Comments

Vincz picture Vincz  ·  3Comments

tkrotoff picture tkrotoff  ·  3Comments

ingro picture ingro  ·  3Comments