163
rated 0 times
[
168]
[
5]
/ answers: 1 / hits: 23545
/ 11 Years ago, wed, november 6, 2013, 12:00:00
I need to get a past date with moment.js (http://momentjs.com/) which I receive in specific format:
moment('31.10.2013', 'dd.mm.yy');
That returns me a strange response where I see a current date in _d
option:
// returns
_a: Array[7]
_d: Wed Nov 06 2013 00:10:00 GMT+0200 (EET)
_f: dd.mm.yy
_i: 26.10.2013
_isUTC: false
_l: undefined
_pf: Object
_strict: undefined
I assume that is the problem when I do formatting:
moment('31.10.2013', 'dd.mm.yy').format('YYYY/MM/DD');
// returns current date (why??!)
// 2013/11/06
So what is wrong here, could I format the past date?
More From » date