diff --git a/Scripts/GenerateCurrentTimestamp.js b/Scripts/GenerateCurrentTimestamp.js new file mode 100644 index 00000000..d93b18db --- /dev/null +++ b/Scripts/GenerateCurrentTimestamp.js @@ -0,0 +1,21 @@ +/** + { + "api":1, + "name":"Generate current timestamp", + "description":"Generate current now time to Unix timestamp.", + "author":"atovk", + "icon":"watch", + "tags":"date,time,calendar,unix,timestamp" + } + **/ + +function main(input) { + + let currentTimeMillis = Date.now() + + if (isNaN(currentTimeMillis)) { + input.postError("Invalid Date") + } else { + input.insert(currentTimeMillis); + } +}