Skip to content

Instantly share code, notes, and snippets.

@shanechin
Last active December 10, 2015 21:29
Show Gist options
  • Save shanechin/4495657 to your computer and use it in GitHub Desktop.
Save shanechin/4495657 to your computer and use it in GitHub Desktop.
My first bookmarklet!
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