JavaScript – Date toLocaleDateString() Method
The Date toLocaleDateString() method returns the date (not the time) of a Date object as a string, using locale conventions.
The Date toLocaleDateString() method returns the date (not the time) of a Date object as a string, using locale conventions.
The Date toLocaleString() method returns a date and time as a string, using locale settings.
The Date toLocaleTimeString() method returns the time portion of a Date object as a string, using locale conventions.
The Date toTimeString() method returns the time portion of a Date object as a string.
The Date toUTCString() method returns a Date object as a string, according to UTC.
The Date.UTC() method returns the number of milliseconds between a specified date and midnight of January 1, 1970, according to UTC.
The Date valueOf() method returns the primitive value of a Date object as the number of millisecond since midnight January 1, 1970 UTC.
This is a quick reference list of JavaScript date methods and properties with examples of how they are used.
The JavaScript Date object can be used to count down to a specified daily time. For instance, this can be used for a “daily deals” timer.
The JavaScript Date object can be used to count down to a specified date and time. For instance, this can be used as a prompt for the user to take action.
JavaScript can be used to write the current date to a page, or to write the year to the page, for instance, in the copyright section of your site.
The PHP checkdate() function is used to check if a Gregorian date is valid.
The PHP date() function formats a local date and time, and returns the formatted date string.
The PHP date_add() function adds a specified number of days, months, years, hours, minutes, and seconds to a date.
The PHP date_create_from_format() function returns a new DateTime object formatted according to the specified format.
The PHP date_default_timezone_get() function returns the default timezone used by all date/time functions in the script.
The PHP date_default_timezone_set() function sets the default timezone used by all date/time functions in the script.