How to use t-a-i - 1 common examples

To help you get started, we’ve selected a few t-a-i examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sony / nmos-js / Development / src / components / TAIField.js View on Github external
const TAIConversion = (record, source, mode) => {
    try {
        const taiData = get(record, source).split(':', 2);
        const taiTimeMilliseconds = 1e3 * taiData[0] + taiData[1] / 1e6;
        if (get(record, mode) === 'activate_scheduled_relative') {
            return dayjs(taiTimeMilliseconds)
                .utc()
                .format('HH:mm:ss.SSS');
        }
        const unixTimeMilliseconds = tai.atomicToUnix(taiTimeMilliseconds);
        return dayjs(unixTimeMilliseconds).format('YYYY-MM-DD HH:mm:ss.SSS Z');
    } catch (e) {
        return `Conversion Error - ${e}`;
    }
};

t-a-i

Converts Unix milliseconds to and from International Atomic Time (TAI) milliseconds

MIT
Latest version published 6 months ago

Package Health Score

66 / 100
Full package analysis

Popular t-a-i functions

Similar packages