下記のブックマークレットをブックマークバーに追加して押すと現在時刻がクリップボードにコピーされる。
chromeなどの初期タブには機能しない。
数字のみ
yyyymmdd 例 20240101
javascript:(function(){var now=new Date();var year=now.getFullYear();var month=('0'+(now.getMonth()+1)).slice(-2);var day=('0'+now.getDate()).slice(-2);var dateTime=year+month+day;var textField=document.createElement('textarea');textField.innerText=dateTime;document.body.appendChild(textField);textField.select();document.execCommand('copy');textField.remove();alert("Complete: "+dateTime);})();
.コロンパターン
yyyy.mm.dd 例 2024.01.01
javascript:(function(){var now=new Date();var year=now.getFullYear();var month=('0'+(now.getMonth()+1)).slice(-2);var day=('0'+now.getDate()).slice(-2);var dateTime=year+'.'+month+'.'+day;var textField=document.createElement('textarea');textField.innerText=dateTime;document.body.appendChild(textField);textField.select();document.execCommand('copy');textField.remove();alert("Complete: "+dateTime);})();
yyyy.mm.dd hh:mm 例 2024.01.01 00:00
javascript:(function(){var now=new Date();var year=now.getFullYear();var month=('0'+(now.getMonth()+1)).slice(-2);var day=('0'+now.getDate()).slice(-2);var hours=('0'+now.getHours()).slice(-2);var minutes=('0'+now.getMinutes()).slice(-2);var dateTime=year+'.'+month+'.'+day+' '+hours+':'+minutes;var textField=document.createElement('textarea');textField.innerText=dateTime;document.body.appendChild(textField);textField.select();document.execCommand('copy');textField.remove();alert("Complete: "+dateTime);})();
yyyy.mm.dd_hh:mm(アンダーバー有り) 例 2024.01.01_00:00
javascript:(function(){var now=new Date();var year=now.getFullYear();var month=('0'+(now.getMonth()+1)).slice(-2);var day=('0'+now.getDate()).slice(-2);var hours=('0'+now.getHours()).slice(-2);var minutes=('0'+now.getMinutes()).slice(-2);var dateTime=year+'.'+month+'.'+day+'_'+hours+':'+minutes;var textField=document.createElement('textarea');textField.innerText=dateTime;document.body.appendChild(textField);textField.select();document.execCommand('copy');textField.remove();alert("Complete: "+dateTime);})();
/スラッシュパターン
yyyy/mm/dd 例 2024/01/01
javascript:(function(){var now=new Date();var year=now.getFullYear();var month=('0'+(now.getMonth()+1)).slice(-2);var day=('0'+now.getDate()).slice(-2);var dateTime=year+'/'+month+'/'+day;var textField=document.createElement('textarea');textField.innerText=dateTime;document.body.appendChild(textField);textField.select();document.execCommand('copy');textField.remove();alert("Complete: "+dateTime);})();
yyyy/mm/dd hh:mm 例 2024/01/01 00:00
javascript:(function(){var now=new Date();var year=now.getFullYear();var month=('0'+(now.getMonth()+1)).slice(-2);var day=('0'+now.getDate()).slice(-2);var hours=('0'+now.getHours()).slice(-2);var minutes=('0'+now.getMinutes()).slice(-2);var dateTime=year+'/'+month+'/'+day+' '+hours+':'+minutes;var textField=document.createElement('textarea');textField.innerText=dateTime;document.body.appendChild(textField);textField.select();document.execCommand('copy');textField.remove();alert("Complete: "+dateTime);})();
yyyy/mm/dd_hh:mm(アンダーバー有り)例 2024/04/07_00:00
javascript:(function(){var now=new Date();var year=now.getFullYear();var month=('0'+(now.getMonth()+1)).slice(-2);var day=('0'+now.getDate()).slice(-2);var hours=('0'+now.getHours()).slice(-2);var minutes=('0'+now.getMinutes()).slice(-2);var dateTime=year+'/'+month+'/'+day+'_'+hours+':'+minutes;var textField=document.createElement('textarea');textField.innerText=dateTime;document.body.appendChild(textField);textField.select();document.execCommand('copy');textField.remove();alert("Complete: "+dateTime);})();