Organizational Research By

Surprising Reserch Topic

converting milliseconds to a date jquery js


converting milliseconds to a date jquery js  using -'javascript,jquery,datetime'

I'm a bit of a rambler, but I'll try to keep this clear -

I'm bored, so I'm working on a "shoutbox", and I'm a little confused over one thing. I want to get the time that a message is entered, and I want to make sure I'm getting the server time, or at least make sure I'm not getting the local time of the user. I know it doesn't matter, since this thing won't be used by anyone besides me, but I want to be thorough. I've looked around and tested a few things, and I think the only way to do this is to get the milliseconds since ?/?/1970 or whatever it is, since that'd be the same for everyone.

I'm doing that like so:

var time = new Date();
var time = time.getTime();


That returns a number like 1294862756114.

Is there a way to convert 1294862756114 to a more readable date, like DD/MM/YYYY HH:MM:SS?

So, basically, I'm looking for JavaScripts equivelant of PHP's date(); function.
    
asked Oct 6, 2015 by pradip.bhoge
0 votes
9 views



Related Hot Questions



Government Jobs Opening


...