Tag Archives: javascript-date

Given an UTC date and the task is to convert UTC date time into local date-time using JavaScript toLocaleString() function. Syntax: var theDate = new… Read More
Given two timestamp then we have to find out whether these time are of same date or not. Here we can use the JavaScript Date… Read More
Given a date, we have to find the number of seconds since the epoch (i.e. 1 January 1970, 00:00:00 UTC ). The getTime() method in… Read More
To obtain date and time in javascript, we have the Date() class. We access Date() class by creating its objects. Date() class returns date and… Read More
Given a date object and the task is to determine whether the given date is the same as today’s date or not with the help… Read More
Given the 2 JavaScript dates and the job is to get the relative time difference between them(eg.. 2 hours ago, 2.5 days ago, etc.) Here… Read More
The task is to determine if the given date is in between the given 2 dates or not? Here are a few of the most… Read More
Given a date and the task is to determine if the given date is weekend (In this case we are considering Saturday as weekend). There… Read More
Given a date and the task is to format the current date in MM/DD/YYYY HH:MM:SS format. Here are a few of the most techniques discussed… Read More
Method 1: Using Intl.DateTimeFormat() and format() Method: The Intl.NumberFormat() method is used to represent numbers in a language-sensitive formatting. It can be used to represent… Read More
Given a date and the task is to check whether the given date is less than 1 hour ago or not with the help of… Read More
Given a date object and the task is to check the given date is valid or not using JavaScript. There are two methods to solve… Read More
Given a date and the task is to get the day and month of a year using JavaScript. Approach: First get the current date by… Read More
Given two dates and the task is to get the array of dates between the two given dates using JavaScript. Approach 1: Select the first… Read More
Given a time in seconds and the task is to convert the time into a string format hh:mm:ss. There are two approaches to solve this… Read More