JavaScript Date Programming Examples Last Updated : 05 Aug, 2025 Comments Improve Suggest changes Like Article Like Report The JavaScript comes with a built-in datatype called the Date object. The Date object is created by using a new keyword, i.e. new Date() . The Date object can be used for date and time in terms of millisecond precision within 100 million days before or after 1/1/1970. JavaScript Date Programming Examples This article contains a wide collection of JavaScript Date object-based questions. All these questions contain all possible approaches to solve the problem. Syntax: new Date() Example: Here is the basic example of a date object. JavaScript let today = new Date(); console.log(today); Output2023-12-06T07:07:37.129Z Note: This output return the current Day Month Date Year Standard Time. All the JavaScript Date-related articles into three sections based on their difficulty levels: Easy, Medium, and Hard. This organization aims to help learners gradually progress from basic to more complex concepts.Easy:The Easy level includes articles that cover fundamental operations and straightforward tasks with JavaScript arrays.How to add days to date in JavaScript? How to convert milliseconds to date in JavaScript? How to get current formatted date dd/mm/yyyy in JavaScript? How to format a date in JavaScript? Convert string into date using JavaScript How to check a date is valid or not using JavaScript? How to validate string date format in JavaScript? How to get day, month and year from date object in JavaScript? How to get the first and last date of current month using JavaScript? How to get month and date of JavaScript in two digit format? How to calculate the yesterday’s date in JavaScript? How to calculate the date three months prior using JavaScript? How to remove time from date using JavaScript? How to check whether an object is a date? How to compare date part only without comparing time in JavaScript? How to get the current date and time in seconds? JavaScript adding hours to the date object How to check if the given date is weekend? How to check if date is less than 1 hour ago using JavaScript? How to get the first day of the year in JavaScript? How to get tomorrow’s date in a string format in JavaScript? JavaScript adding minutes to date object JavaScript increment a given date How to calculate days left until next Christmas using JavaScript? How to check for two timestamp for the same day? JavaScript Date Formats How to get the number of days in a specified month using JavaScript? JavaScript Date Objects JavaScript adding seconds to date object How to check the input date is equal to today’s date or not using JavaScript? How to convert seconds to time string format hh:mmusing JavaScript? How to convert a JavaScript date to UTC? Medium:The Medium level includes articles that delve deeper into working with JavaScript arrays, exploring more advanced operations and methods:How to sort an object array by date in JavaScript? How to convert date to another timezone in JavaScript? How to get the day and month of a year using JavaScript? How to format current date in mm/dd/yyyy hh:mmformat using JavaScript? How to get the last week’s date using JavaScript? How to convert UTC date time into local date time using JavaScript? JavaScript get the start and end of the day in UTC How to get the first day of the year in JavaScript? How to calculate minutes between two dates in JavaScript? How to store all dates in an array present in between given two dates in JavaScript? Get the relative timestamp difference between dates in JavaScript How to convert cfabsolutetime to date object and vice versa in JavaScript? How to get seconds since epoch in JavaScript? Calculate current week number in JavaScript How do you display JavaScript datetime in 12 hour AM/PM format? JavaScript program to convert date to number How to set timezone offset using JavaScript? JavaScript program to convert date to string JavaScript subtract days from date object How to check if one date is between two dates in JavaScript? Hard:The Hard level includes articles that cover more intricate and less common tasks How to convert cfabsolutetime to date object and vice versa in JavaScript? How to convert date to another timezone in JavaScript? How to convert a JavaScript date to UTC? How to set timezone offset using JavaScript? JavaScript get the start and end of the day in UTC We have created a complete list of JavaScript Date Objects, to check those, please go through this JavaScript Date Object Complete Reference article. We have created an article of JavaScript Examples, and added list of questions based on Array, Object, Function, ..., etc. Please visit this JavaScript Examples to get complete questions based articles list of JavaScript. We have created a complete JavaScript Tutorial to help both beginners and experienced professionals. Please check this JavaScript Tutorial to get the complete content from basic syntax and data types to advanced topics such as object-oriented programming and DOM manipulation. Recent articles on JavaScript Comment More infoAdvertise with us V vishalkumar2204 Follow Improve Article Tags : JavaScript Web Technologies javascript-date JavaScript-Questions Explore JavaScript BasicsIntroduction to JavaScript4 min readJavaScript Versions2 min readHow to Add JavaScript in HTML Document?3 min readJavaScript Syntax6 min readJavaScript Output4 min readJavaScript Comments2 min readVariables & DatatypesVariables and Datatypes in JavaScript6 min readGlobal and Local variables in JavaScript4 min readJavaScript Let6 min readJavaScript const5 min readJavaScript Var Statement7 min readOperatorsJavaScript Operators5 min readOperator precedence in JavaScript2 min readJavaScript Arithmetic Operators5 min readJavaScript Assignment Operators5 min readJavaScript Comparison Operators5 min readJavaScript Logical Operators5 min readJavaScript Bitwise Operators5 min readJavaScript Ternary Operator4 min readJavaScript Comma Operator2 min readJavaScript Unary Operators4 min readJavaScript in and instanceof operators3 min readJavaScript String Operators3 min readStatementsJavaScript Statements4 min readJavaScript if-else3 min readJavaScript switch Statement4 min readJavaScript Break Statement2 min readJavaScript Continue Statement1 min readJavaScript Return Statement4 min readLoopsJavaScript Loops3 min readJavaScript For Loop4 min readJavaScript While Loop3 min readJavaScript For In Loop3 min readJavaScript for...of Loop3 min readJavaScript do...while Loop4 min readPerformance & DebuggingJavaScript | Performance4 min readDebugging in JavaScript4 min readJavaScript Errors Throw and Try to Catch2 min readObjectsObjects in Javascript4 min readObject Oriented Programming in JavaScript3 min readJavaScript Objects6 min readCreating objects in JavaScript5 min readJavaScript JSON Objects3 min readJavaScript Object Reference4 min readFunctionsFunctions in JavaScript4 min readHow to write a function in JavaScript ?4 min readJavaScript Function Call2 min readDifferent ways of writing functions in JavaScript3 min readDifference between Methods and Functions in JavaScript3 min readExplain the Different Function States in JavaScript3 min readJavaScript Function Complete Reference3 min readArraysJavaScript Arrays7 min readJavaScript Array Methods7 min readBest-Known JavaScript Array Methods6 min readImportant Array Methods of JavaScript7 min readJavaScript Array Reference4 min readStringJavaScript Strings6 min readJavaScript String Methods9 min readJavaScript String Reference4 min read Like