PHP Classes

File: upload/themes/bb_simple/assets/moment/src/lib/create/date-from-array.js

Recommend this page to a friend!
  Classes of James Brows   PHP Bulletin Board   upload/themes/bb_simple/assets/moment/src/lib/create/date-from-array.js   Download  
File: upload/themes/bb_simple/assets/moment/src/lib/create/date-from-array.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Bulletin Board
Manage and post messages in multi-user forums
Author: By
Last change:
Date: 2 years ago
Size: 637 bytes
 

Contents

Class file image Download
export function createDate (y, m, d, h, M, s, ms) { // can't just apply() to create a date: // https://stackoverflow.com/q/181348 var date = new Date(y, m, d, h, M, s, ms); // the date constructor remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { date.setFullYear(y); } return date; } export function createUTCDate (y) { var date = new Date(Date.UTC.apply(null, arguments)); // the Date.UTC function remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } return date; }