ProblemYou want to retrieve the year, month, day of month, day of week, hour, minute, second, or millisecond value from a Date object. SolutionUse the fullYear, date, month, day, hours, minutes, seconds, or milliseconds properties. DiscussionThe fullYear, date, month, day, hours, minutes, seconds, and milliseconds properties return the values from a Date object:
Each of these properties has a UTC (Coordinated Universal Time, also known as Greenwich Mean Time) correspondent. For example, although the hours property returns the current hours value based on the client computer's clock, the hoursUTC property returns the current hours value in UTC time. |