JavaScript Date Formats | ISO Date | Short Date | Long Date @arvindprogramming
In JavaScript, the `Date` object supports several different date formats. Some commonly used date formats are:
1. ISO 8601 Format (YYYY-MM-DDTHH:mm:ss.sssZ):
`toISOString()`: Returns the date in a string format following the ISO 8601 format.
2. UTC Date Formats:
`toUTCString()`: Returns a string in the format "Thu, 01 Jan 1970 00:00:00 UTC".
`toGMTString()`: Returns a string in the format "Thu, 01 Jan 1970 00:00:00 GMT".
3. Locale-Specific Date Formats:
`toLocaleString()`: Returns a string representing the date and time in the current locale. The format varies based on the user's location.
4. Custom Date Formats:
`getDate()`, `getMonth()`, `getFullYear()`, `getHours()`, `getMinutes()`, `getSeconds()`, `getMilliseconds()`: You can extract individual date components and format them as needed.
Additionally, JavaScript libraries such as Moment.js provide more functionalities and flexible date formatting options, including the ability to define custom date formats.
Social Media Links-
Facebook Page -- / arvindweb Coaching-Programming & Games/
Facebook - / arvindweb
Twitter - / arvindwebspn
YouTube - / @arvindprogramming
Instagram - / arvindprogramming