mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Base: Move "js" and "little" HackStudio projects into ~/Source/
This commit is contained in:
14
Base/home/anon/Source/js/date.js
Normal file
14
Base/home/anon/Source/js/date.js
Normal file
@@ -0,0 +1,14 @@
|
||||
var now = Date.now();
|
||||
console.log("Unix timestamp: " + now / 1000);
|
||||
|
||||
var d = new Date();
|
||||
var year = d.getFullYear();
|
||||
var month = (d.getMonth() + 1).toString().padStart(2, "0");
|
||||
var day = d.getDate().toString().padStart(2, "0");
|
||||
var hours = d.getHours().toString().padStart(2, "0");
|
||||
var minutes = d.getMinutes().toString().padStart(2, "0");
|
||||
var seconds = d.getSeconds().toString().padStart(2, "0");
|
||||
var milliseconds = d.getMilliseconds().toString().padStart(3, "0");
|
||||
|
||||
console.log("Date: " + year + "-" + month + "-" + day);
|
||||
console.log("Time: " + hours + ":" + minutes + ":" + seconds + "." + milliseconds);
|
||||
Reference in New Issue
Block a user