/** * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal */ export function dateToUtcString(date: Date) { return date.toISOString().replace(/T/, ' ').replace(/\..+/, ''); } export function getFormattedTime() { const today = new Date(); const y = today.getFullYear(); const m = today.getMonth() + 1; const d = today.getDate(); const h = today.getHours(); const mi = today.getMinutes(); const s = today.getSeconds(); return y + '-' + m + '-' + d + '-' + h + '-' + mi + '-' + s; }