Nodejs Utililty Methods Date GMT UTC Get

List of utility methods to do Date GMT UTC Get

Description

The list of methods to do Date GMT UTC Get are organized into topic(s).

Method

utc()
Date.prototype.utc = function(){
  return new Date();
};
utc(func)
Date.prototype.utc = function(func) {
    "use strict";
    return new Date(this.getUTCFullYear(), this.getUTCMonth(), this.getUTCDate(),  this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds());
};
utcZero()
Date.prototype.utcZero = function(){
  return new Date(this.getTime() + this.getTimezoneOffset()*60*1000);
};
getTimeUTC()
Date.prototype.getTimeUTC = function () {
    return this.getTime() + this.getTimezoneOffset() * 60 * 1000;
};
getUTCFullDate()
Date.prototype.getUTCFullDate = function() {
  return this.getUTCFullYear() + '-' + (this.getUTCMonth() + 1) + '-' + this.getUTCDate();
};
getUtcDateObject()
Date.prototype.getUtcDateObject = function () {
    return new Date(this.toUTCString());