Last active
December 10, 2015 21:29
-
-
Save shanechin/4495657 to your computer and use it in GitHub Desktop.
My first bookmarklet!
This file contains 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
javascript: (function(){ | |
var today = new Date(); | |
var day = today.getDate(); | |
var month = today.getMonth() + 1; | |
/* January starts with zero */ | |
var year = today.getFullYear(); | |
var thisDate = month + '/' + day + '/' + year; | |
alert(thisDate); | |
/* Trying to write to the document is actually unneccessarily complicated. document.write(thisDate)*/ | |
}()); | |
/* I previously used the other comment style, which broke the bookmarklet */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment