ToLocaleString – Converts a date to a string following the local standard. ToGMTString – Converts a date object to a string following the pattern Internet GMT. The value should be greater than or equal to 1900. SetYear – Establishes a new value annually. GetYear – Gets a numerical value corresponding to the year. This time is given in minutes, just to find out the time zone, you must divide the result obtained by this function for 60.Įg.: Timezone NewObject.getTimezoneOffset = () / 60 GetTimezoneOffset – Gets the difference between local time and the time of the central meridian (Greenwich). The only drawback is that this date is given in milliseconds.Įg: BirthDate = new Date (“August 2, 1970”) GetTime – Gets the time from 01/01/70 to date. SetSeconds – Sets a new value for the seconds. GetSeconds – Gets a number corresponding to the second, returning a numeric value between 0.59 SetMinutes – Sets a new value for minutes. GetMinutes – Gets a number corresponding minutes, returning a numeric value between 0.59 SetHours – Sets a new value for the hour. GetHours – Gets a number corresponding to time, returning a numeric value between 0.23
Remember that the week starts on Sunday, so 0 is Sunday GetDay – Gets the number of the day, considering the week, returning a numeric value between 0.6. GetDate – Gets the number of the day, considering the month, returning a numeric value between 1.31. SetMonth – Sets a new value for the month. GetMonth – Gets the number of the month, returning a value between 0 and 11 (January = 0) The Date object has a number of methods that aim to assist in identifying important temporal elements. NewObject = Object defined by user to handle dates.The instance of the object is given as follows: As any object, you can create new instances and this practice enables the use of how many date objects are required. Date is a very useful object that returns the date and time of the system in the following format: Weekday, month name, Month Day, Hour:Minute:Second and Year.