diff options
Diffstat (limited to 'node_modules/locutus/php/datetime/date_parse.js')
-rw-r--r-- | node_modules/locutus/php/datetime/date_parse.js | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/node_modules/locutus/php/datetime/date_parse.js b/node_modules/locutus/php/datetime/date_parse.js deleted file mode 100644 index 20df2bf..0000000 --- a/node_modules/locutus/php/datetime/date_parse.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -module.exports = function date_parse(date) { - // eslint-disable-line camelcase - // discuss at: http://locutus.io/php/date_parse/ - // original by: Brett Zamir (http://brett-zamir.me) - // example 1: date_parse('2006-12-12 10:00:00') - // returns 1: {year : 2006, month: 12, day: 12, hour: 10, minute: 0, second: 0, fraction: 0, is_localtime: false} - - var strtotime = require('../datetime/strtotime'); - var ts; - - try { - ts = strtotime(date); - } catch (e) { - ts = false; - } - - if (!ts) { - return false; - } - - var dt = new Date(ts * 1000); - - var retObj = {}; - - retObj.year = dt.getFullYear(); - retObj.month = dt.getMonth() + 1; - retObj.day = dt.getDate(); - retObj.hour = dt.getHours(); - retObj.minute = dt.getMinutes(); - retObj.second = dt.getSeconds(); - retObj.fraction = parseFloat('0.' + dt.getMilliseconds()); - retObj.is_localtime = dt.getTimezoneOffset() !== 0; - - return retObj; -}; -//# sourceMappingURL=date_parse.js.map
\ No newline at end of file |