Created
August 23, 2011 06:49
-
-
Save jamesmartin/1164505 to your computer and use it in GitHub Desktop.
File this one in the dumb bucket.
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
| parseInt(Date().split(" ")[4].split(":")[1]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Javascript's
Date()returns the current date, as a string, like this:The code above was supposed to parse this string and return the current minute as an integer.
Of course, it returns
0for the first ten minutes of the hour.And that's how I learnt about
new Date().getMinutes().Know your language, kids.