Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
162
rated 0 times [  168] [ 6]  / answers: 1 / hits: 16803  / 15 Years ago, thu, october 1, 2009, 12:00:00

I'm trying to write a javascript function that calculates the time since Oct 11th, 1910 so I can throw it into a timer for a project I'm working on. I get that javascript's milliseconds works from epoc, but I don't and can't find a way to get the milliseconds since a date earlier than 01.01.1970



Does anyone have any loose code that can do the above that they may be willing to share?


More From » date

 Answers
11



var oldGoodTimes = new Date(1910, 9, 11); // January = 0
var actualDate = new Date();
console.log(actualDate.getTime() - oldGoodTimes.getTime());




[#98585] Sunday, September 27, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jaelynncherokeeg

Total Points: 697
Total Questions: 109
Total Answers: 104

Location: France
Member since Thu, Mar 18, 2021
3 Years ago
jaelynncherokeeg questions
Thu, May 27, 21, 00:00, 3 Years ago
Fri, Jan 24, 20, 00:00, 4 Years ago
Thu, Nov 14, 19, 00:00, 5 Years ago
Wed, Sep 18, 19, 00:00, 5 Years ago
;