UNPKG

molstar

Version:

A comprehensive macromolecular library.

19 lines (18 loc) 605 B
/** * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal <david.sehnal@gmail.com> */ export function dateToUtcString(date) { return date.toISOString().replace(/T/, ' ').replace(/\..+/, ''); } export function getFormattedTime() { var today = new Date(); var y = today.getFullYear(); var m = today.getMonth() + 1; var d = today.getDate(); var h = today.getHours(); var mi = today.getMinutes(); var s = today.getSeconds(); return y + '-' + m + '-' + d + '-' + h + '-' + mi + '-' + s; }