Millisecond
I don't know much of JavaScript but I can be done. Since the time is taken from January 1st, 1970 and is counted in seconds then you just do the internal math to figure out how many milliseconds that is. 1000 milliseconds equals a second. So take the current second count and just multiply it by 1000 for the number of milliseconds since 1970.
I don't understand how you could convert the current time into milliseconds. You have to find out from what time to what time = x number of milliseconds.
VulKen
Just babblin'
Pimpin like a pimp with an electrofied pimpin machine!
dhaliwam posted this at 14:53 — 21st June 2000.
They have: 39 posts
Joined: Jun 2000
Is it possible in JavaScript to get millisecond for current data and time i.e. is it possible to convert current date amd time into milliseconds?
Thanks!
Lloyd Hassell posted this at 14:46 — 22nd June 2000.
They have: 231 posts
Joined: Feb 2000
There is a method of the Date object that returns a date as a millisecond representation since Jan 1 1970. It is the 'parse()' method. This is handy when comparing 2 dates.
var currentDateObj = new Date;
var currentDateMilliseconds = Date.parse(currentDateObj)
:: Lloyd Hassell :: http://www14.brinkster.com/lloydh ::
dhaliwam posted this at 15:03 — 22nd June 2000.
They have: 39 posts
Joined: Jun 2000
Yes, you are right, I did same thing yesterday
var num2 = new Date();
var number_id = num2.getTime();
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.