Sha256: cd9dac3728f7afc4ea070301ffd72f05d3143e6e73919acdf50304c554d54ccb
Contents?: true
Size: 410 Bytes
Versions: 69
Compression:
Stored size: 410 Bytes
Contents
var pad = require('../number/pad'); /** * time zone as hour and minute offset from UTC (e.g. +0900) */ function timezoneOffset(date){ var offset = date.getTimezoneOffset(); var abs = Math.abs(offset); var h = pad(Math.floor(abs / 60), 2); var m = pad(abs % 60, 2); return (offset > 0? '-' : '+') + h + m; } module.exports = timezoneOffset;
Version data entries
69 entries across 69 versions & 2 rubygems