Native Date vs. 1.1.0 Full+Lite

The JavaScript Date object can be used to represent arbitrary dates and times, to get the current system date, and to calculate differences between dates. It has several predefined properties and methods. The Date object stores a day of the week; a month, day, and year; and a time in hours, minutes, seconds, and milliseconds. This information is based on the number of milliseconds since January 1, 1970, 00:00:00.000 Coordinated Universal Time (UTC), formerly known as Greenwich Mean Time. JavaScript can handle dates that are in the approximate range from 250,000 B.C. to 255,000 A.D., although some formatting functionality is supported only for dates in the range 0 A.D. through 9999 A.D. More details can be found at MSDN or MDN.

The NoGray JavaScript Library extends the Date object with methods for additional calculating and formatting dates.

Methods

Function Date.clone () vs. 1.1.0 Full+Lite
Clone the original date.
Function Date.days_in_month () vs. 1.1.0 Full+Lite
Return the number of days in the month.
Function Date.is_leap_year () vs. 1.1.0 Full+Lite
Check if the year is a leap year.
Function Date.from_string (str) vs. 1.1.0 Full+Lite
Create a date from a given string. The string should be a valid date in a commen format.
Function Date.from_object (obj) vs. 1.1.0 Full+Lite
Create a date from a given JavaScript object.
Function Date.print (format, lang) vs. 1.1.0 Full+Lite
Returns a formatted date string. This function uses similar formatting options as the PHP date function. The only exception is the Y and o will return the same value.
Function Date.get_week_in_year () vs. 1.1.0 Full+Lite
Returns week number in the year.
Function Date.get_day_in_year () vs. 1.1.0 Full+Lite
Return the day number in the year.
Function Date.get_hour_in_year () vs. 1.1.0 Full+Lite
Get the hour number in the year.
Function Date.get_minute_in_year () vs. 1.1.0 Full+Lite
Get the minute number in the year.
Function Date.get_second_in_year () vs. 1.1.0 Full+Lite
Get the second number in the year.
Function Date.get_millisecond_in_year () vs. 1.1.0 Full+Lite
Get the millisecond in the year.
Function Date.get_week_since (start_date) vs. 1.1.0 FULL ONLY
Get the week number since a given date.
Function Date.get_day_since (start_date) vs. 1.1.0 FULL ONLY
Get the day number since a given date.
Function Date.get_hour_since (start_date) vs. 1.1.0 FULL ONLY
Get the number of hour since the given date.
Function Date.get_minute_since (start_date) vs. 1.1.0 FULL ONLY
Get the number of minute since the given date.
Function Date.get_second_since (start_date) vs. 1.1.0 FULL ONLY
Get the second number since the given date.
Function Date.get_millisecond_since (start_date) vs. 1.1.0 FULL ONLY
Get the millisecond number the given date.
Function Date.time_difference (start_date) vs. 1.1.0 Full+Lite
Returns difference between two dates in milliseconds.
Function Date.to_swatch_internet_time () vs. 1.1.0 Full+Lite
Returns the number of beats as a string (including the @ sign).
Function Date.from_swatch_internet_time (beat) vs. 1.1.0 Full+Lite
Returns a JavaScript Date object (approximate time) from the given beat.
Function Date.to_query () vs. 1.1.0 FULL ONLY
Create a URL query formatted string from the date.
Function Date.to_json () vs. 1.1.0 FULL ONLY
Create a JSON string from the date.