enjoy…
/* get current local date and time */
silverbullet.registerFunction({name: "localtime"}, () => {
const options = {
timezone: 'America/Los_Angeles', /* replace with your local TZ */
hour12: false,
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit'
};
const d = new Date();
let t = d.toLocaleString('en-US',options); /* mm/dd/yyyy, HH:MM:ss */
t = t.replace(/,/,'');
t = t.slice(6,10) + '-' + /* yyyy */
t.slice(0,2) + '-' + /* mm */
t.slice(3,5) + ' ' + /* dd */
t.slice(-8); /* HH:MM:ss */
return t; /* yyyy-mm-dd HH:MM:ss */
})