Created
March 30, 2020 11:36
-
-
Save bespr/a8efb2fcae575e06f014e4232e0bbe71 to your computer and use it in GitHub Desktop.
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 text = ""; var activeEl = document.activeElement; var activeElTagName = activeEl ? activeEl.tagName.toLowerCase() : null; if ( (activeElTagName == "textarea") || (activeElTagName == "input" && /^(?:text|search|password|tel|url)$/i.test(activeEl.type)) && (typeof activeEl.selectionStart == "number") ) { text = activeEl.value.slice(activeEl.selectionStart, activeEl.selectionEnd); } else if (window.getSelection) { text = window.getSelection().toString(); } var timestamp = parseInt(text) * 1000; var d = new Date(); d.setTime(timestamp); alert(d.toString()); }()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment