Skip to content

Instantly share code, notes, and snippets.

@shanechin1
shanechin1 / date bookmarklet.js
Last active March 1, 2017 02:05
My first attempt at a bookmarklet. A simple one which inserts the current date on a page.
javascript: (function(){
alert("Hello?!");
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);