This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Time value? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Time value?" Watch "Time value?" New topic
Author

Time value?

nirjari patel
Ranch Hand

Joined: Apr 23, 2009
Posts: 265
var expirationDate = new Date();
expirationDate.setTime(expirationDate.getTime()
+ 1000*60*60*24*30);

In this code expirationDate.getTime() gives time in milli seconds. I got 1321924420144, when I tried this code at 8:13 pm on November 11, 2011. So my confusion is, this 1321924420144 is from when ? Is it from 00 hours of November 11, 2011 ? Or is starting time some different point ?
If its from 00 hours of November 11, 2011, then numbers don't match.

(1321924420144) / (1000*60*60) = 367201. So what kind of time is this ? Please explain, what does this figure returned by getTime() mean ?

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56554
    
  14

Milliseconds since Jan 1, 1970 (UNIX base time).


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15362
    
    6
Get yourself a good reference: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date

Eric
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Time value?
 
Similar Threads
Calendar() / Date() bug ???
Passing java dates timestamp to Javascript's date object
Converting to UTC time zone
Question about Calendar
DST issue with GregorianCalendar