Fichtelgard

Generate YYYY-MM-DDTHH:MM:SS+TZ

export function getCurrentTimeString(): string {
const date = new Date();

const day = addZero(date.getDate());
const month = addZero(date.getMonth() + 1);
const year = date.getFullYear();
const hours = addZero(date.getHours());
const minutes = addZero(date.getMinutes());
const second = addZero(date.getSeconds());
const timezone = date.getTimezoneOffset();

return (
year +
"-" +
month +
"-" +
day +
"T" +
hours +
":" +
minutes +
":" +
second +
"+" +
timezone
);
}