How to get tomorrow's date in a string format in JavaScript ? Last Updated : 30 Dec, 2022 Comments Improve Suggest changes Like Article Like Report In this article, we will see how to print tomorrow's date in string representation using JavaScript. To achieve this, we use the Date object and create an instance of it. After that by using the setDate() method, we increase one date to the present date. Now by using the getDate() method you will get tomorrow's date. Now to convert that date to the string we use the string template literals, getFullYear, getMonth, padStart methods. Below is the implementation of this: Example: In this example, we will get tomorrow's date in the string format. JavaScript <script> const tomorrow = () => { // Creating the date instance let d = new Date(); // Adding one date to the present date d.setDate(d.getDate() + 1); let year = d.getFullYear() let month = String(d.getMonth() + 1) let day = String(d.getDate()) // Adding leading 0 if the day or month // is one digit value month = month.length == 1 ? month.padStart('2', '0') : month; day = day.length == 1 ? day.padStart('2', '0') : day; // Printing the present date console.log(`${year}-${month}-${day}`); } tomorrow() </script> Output: "2022-12-31" Example 2: In this example, we will get the already given date into the string format. JavaScript <script> const tomorrow = (dt) => { // Creating the date instance let d = new Date(dt); // Adding one date to the present date d.setDate(d.getDate() + 1); let year = d.getFullYear() let month = String(d.getMonth() + 1) let day = String(d.getDate()) // Adding leading 0 if the day or month // is one digit value month = month.length == 1 ? month.padStart('2', '0') : month; day = day.length == 1 ? day.padStart('2', '0') : day; // Printing the present date console.log(`${year}-${month}-${day}`); } tomorrow("2020-12-31") tomorrow("2021-02-28") tomorrow("2021-4-30") </script> Output: "2021-01-01" "2021-03-01" "2021-05-01" Note: Enter the date in yyyy-mm-dd format. Comment More info D devi_johns Follow Improve Article Tags : JavaScript Web Technologies javascript-functions javascript-date JavaScript-Methods JavaScript-Questions +2 More Explore JavaScript BasicsIntroduction to JavaScript4 min readVariables and Datatypes in JavaScript6 min readJavaScript Operators5 min readControl Statements in JavaScript4 min readArray & StringJavaScript Arrays7 min readJavaScript Array Methods7 min readJavaScript Strings5 min readJavaScript String Methods9 min readFunction & ObjectFunctions in JavaScript5 min readJavaScript Function Expression3 min readFunction Overloading in JavaScript4 min readObjects in JavaScript4 min readJavaScript Object Constructors4 min readOOPObject Oriented Programming in JavaScript3 min readClasses and Objects in JavaScript4 min readWhat Are Access Modifiers In JavaScript ?5 min readJavaScript Constructor Method7 min readAsynchronous JavaScriptAsynchronous JavaScript2 min readJavaScript Callbacks4 min readJavaScript Promise4 min readEvent Loop in JavaScript4 min readAsync and Await in JavaScript2 min readException HandlingJavascript Error and Exceptional Handling6 min readJavaScript Errors Throw and Try to Catch2 min readHow to create custom errors in JavaScript ?2 min readJavaScript TypeError - Invalid Array.prototype.sort argument1 min readDOMHTML DOM (Document Object Model)9 min readHow to select DOM Elements in JavaScript ?3 min readJavaScript Custom Events4 min readJavaScript addEventListener() with Examples9 min readAdvanced TopicsClosure in JavaScript4 min readJavaScript Hoisting6 min readScope of Variables in JavaScript3 min readJavaScript Higher Order Functions7 min readDebugging in JavaScript4 min read Like