3
I have a date in the following format: 1424102400000 , that is, an integer value. (I don’t know how to say the name of this format).
I need to convert it to a value presentable to the user, so far so good. I’m using the method toUTCString() and I can also use the momentjs. So the value shown above is the same as Mon, 16 Feb 2015 16:00:00 GMT.
The issue is that such value presented to the user can be changed and then I need to convert it again to an integer value similar to the pattern I initially presented (of course the value will be different if the user has made any changes).
Can someone help me?
Look at that Fiddle, values do not match!
http://jsfiddle.net/tp1dgjgv/
– Fernando Medeiros
change to valueOf() just as I said, the difference is that one is 1000 times bigger, if Voce uses Unix() and multiply by *1000 is pretty much the same thing
– Fernando Medeiros
this format seems to be timestamp, the problem happens because of the milliseconds, set the value of seconds and milliseconds to 0 in the input and output;
– Ivan Ferrer