Showing posts from August, 2023

Javascript Date Methods

Date plays an important role in tracking moments when an event has occurred. new Date() returns a Date object with current date and time(Ex: Sat Aug 05 2023 13:13:26 GMT+0530 (India Standard Time)). const d = new Date("2023-03-24");//Date is 2023-03-24 const d = new Date();// Below are the different kinds of date formats that are accepted(Y-Year;M-Month;D-Date) ISO (YYYY-MM-DD) const d = new Date("2024-06-29") Short (MM/DD/YYYY) const d=new Date("06/29/2024"); Long (MMM DD YYYY )(DD MMM YYYY) Note : Month and Date order can be in any order. Separator can