This is my first foray into javascript, and I've hit something I'm not understanding.
Searching for code samples, I found a snippet that calculated the number of years since 1/1/1970 - then modified it to show me the years, months, days, hours, minutes and seconds.
And that's where I hit the problem. Invariably, the result has four extra hours in it! For example, it's now 1600 but the routine will tell me that 20 hours have elapsed in today.
Could this be because of the 4-hour offset from UTC in my time zone? (This happens in IE, Firefox and Opera; haven't tried with any others.) Is there a way to retrieve the system's UTC offset?
.
Searching for code samples, I found a snippet that calculated the number of years since 1/1/1970 - then modified it to show me the years, months, days, hours, minutes and seconds.
And that's where I hit the problem. Invariably, the result has four extra hours in it! For example, it's now 1600 but the routine will tell me that 20 hours have elapsed in today.
Could this be because of the 4-hour offset from UTC in my time zone? (This happens in IE, Firefox and Opera; haven't tried with any others.) Is there a way to retrieve the system's UTC offset?
.