Skip to content

Instantly share code, notes, and snippets.

@dkordik
Created September 13, 2013 15:46
Show Gist options
  • Save dkordik/6552418 to your computer and use it in GitHub Desktop.
Save dkordik/6552418 to your computer and use it in GitHub Desktop.
w3schools to/get date methods, by example... which it should be in the first place. JS console to the rescue!
anchors=document.querySelectorAll("table a");
for (i=0; i < anchors.length; i++) {
if (anchors[i].innerText.match(/(to|get).*\(\)/) ) {
var method = anchors[i].innerHTML;
method=method.substring(0, method.length-2);
console.log(method, " -- ", new Date()[method]()); }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment