YYYY-MM-DD形式で今日の日付文字列を返すUserScript
YYYY-MM-DD
形式で今日の日付文字列を返す
UserScript
code:script.js
export const today = () => {
const date = new Date();
const today_y = date.getFullYear();
const today_m = date.getMonth()+1;
const today_d = date.getDate();
return ("
"+today_y+'-'+('0' + today_m).slice(-2)+'-'+('0' + today_d).slice(-2)+"
");
}