How to use the unix function from moment-timezone

Find comprehensive JavaScript moment-timezone.unix code examples handpicked from public code repositorys.

618
619
620
621
622
623
624
625
626
627

let pastTimeDifference;
let futureTimeDifference;

const currentTime = moment.unix(moment().format('X'));
const time = moment.unix(moment(formattedVal).format('X'));

switch (allowedPastTimeUnit) {
  case 'seconds':
    pastTimeDifference = Math.ceil(moment.duration(currentTime.diff(time)).asSeconds());
fork icon77
star icon54
watch icon20

+ 14 other calls in file

225
226
227
228
229
230
231
232
233
234
  has_legacy_payments_capability: hasLegacyPaymentsCapability
}

if (fullStripeAccountDetails.requirements.current_deadline) {
  formattedStripeAccount.requirements = {
    current_deadline: moment.unix(fullStripeAccountDetails.requirements.current_deadline).format('D MMMM YYYY')
  }
}

return formattedStripeAccount
fork icon13
star icon19
watch icon18

+ 3 other calls in file

561
562
563
564
565
566
567
568
569
570
formatTimeUnix: function (value, format='HH:mm:ss') {
    if(!value)
    {
        return "";
    }
    return moment.unix(value).format(format);
},
//---------------------------------------------------------------------
formatTimeUTC: function (value, format='HH:mm') {
    if(!value)
fork icon1
star icon4
watch icon3

+ 2 other calls in file