So wanted to try to convert Unix Time Stamps not be using keywords or shortcuts. I wanted to have multiple loops that subtract from the millisecond (year worth), then add to, for instance, a year variable.
while (date > 31557600) {
date -= 31557600;
year++;
}
Here is the full code --> https://repl.it/@John_Nicole/LinedObesePinkriverdolphin
Note that i convert it to seconds at line 10.
Everything works fine but the hours. I thought Unix started at 12:00 pm on January 1st, 1970.
var year = 1970;
var month = 1;
var day = 1;
var hour = 0;
var minute = 0;
var second = 0;
Instead of '12:45.40' I get '17:45.40'.
I have no idea why, 60^2 = 3600 seconds in a hour.