🕰

Script key

Posted by pca2

Install

Details

Label 🕰
Voice Over
Script
var now = new Date();
var dd = now.getDate();
var mm = now.getMonth()+1;
var yyyy = now.getFullYear();
var min = now.getMinutes();
var sec = now.getSeconds();
var hh = now.getHours();

var add_zero = function(int){
  if(int<10) {
     int='0'+int
  };
  return int; 
};

dd = add_zero(dd);
mm = add_zero(mm);
min = add_zero(min);
sec = add_zero(sec);
hh = add_zero(hh);

var date = yyyy+'-'+mm+'-'+dd+'_'+hh+min+sec;
var selRange = getSelectedRange();
setSelectedText(date);
setSelectedRange(selRange[0]+date.length,0);

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus