This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Time value?

 
nirjari patel
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64970
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Milliseconds since Jan 1, 1970 (UNIX base time).
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Get yourself a good reference: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic