UNPKG

@swrve/smarttv-sdk

Version:

Swrve marketing engagement platform SDK for SmartTV OTT devices

18 lines (17 loc) 671 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class DateHelper { static dateToSwrveISOString(date) { return `${date.toISOString().split('.')[0]}Z`; } static dateToSwrveYYYYMMDDFormat(date) { return date.toISOString().split('T')[0].replace(/-/g, ''); } static dateToUTCDate(date) { return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds())); } static nowInUtcTime() { return DateHelper.dateToUTCDate(new Date()).getTime(); } } exports.default = DateHelper;