Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Time it has been since Tuesday, January 1st, 2019
var os = new Date(); var heck = Math.round((((((os.getTime()/1000)/60)/60)/24)/365)/4) var seconds = os.getTime()/1000-1545264000; var minutes = 0; var hours = 0; var days = 0-heck; var years = 0; while (seconds >= 60) { seconds-=60; minutes++; } while (minutes >= 60) { minutes-=60; hours++; } while (hours >= 24) { hours-=24; days++; } while (days >= 365) { days-=365; years++; } // LINE OF STRINGS ------------------------------------ if (years < 10) { years = years.toString(); years = "0"+years; } if (days < 10) { days = days.toString(); days = "0"+days; } if (hours < 10) { hours = hours.toString(); hours = "0"+hours; } if (minutes < 10) { minutes = minutes.toString(); minutes = "0"+minutes; } if (seconds < 10) { seconds = seconds.toString(); seconds = "0"+seconds; } seconds = seconds.toString(); var i; for (i = 0; i < seconds.length; i++) { if (seconds.substring(i-1,i) == ".") { seconds = seconds.substring(0,i-1); } } print("yy:dd:hh:mm:ss") print(years+":"+days+":"+hours+":"+minutes+":"+seconds)
run
|
edit
|
history
|
help
0
CWG - pages
class Node
123141242342
js
binary
Tyu
2-D Kinematics with accurate air drag
LazyListJS
Prime Factors
Viktor Schelochkov