Created
October 31, 2014 10:08
-
-
Save deostroll/02a7d7f9e691b70cdb20 to your computer and use it in GitHub Desktop.
javascript print time in hh:mm:ss format - simple way
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function(dt) { | |
| return [dt.getHours(), dt.getMinutes(), dt.getSeconds()].map(function(n) { | |
| return n < 10 ? '0' + n : n | |
| }).join(':'); | |
| })(new Date()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment