Skip to content

Latest commit

 

History

History
41 lines (35 loc) · 4.8 KB

File metadata and controls

41 lines (35 loc) · 4.8 KB

Date

Selecting a Date Range in CSS 4/11/26
Date is out, Temporal is in 1/13/26
How to get Date values with vanilla JavaScript 4/14/23
Automatic night mode with vanilla JS 12/7
How to create and work with timestamps in vanilla JS 9/26
How to get the relative time between two dates with vanilla JS 9/23
How to get the date N seconds, minutes, hours, or days in the past or future with vanilla JS 9/22
Converting and formatting dates and times with the vanilla JS Intl.DateTimeFormat() constructor 8/27
https://epoch.now.sh/
https://date-fns.org/

Static methods

.now() The Date.now() method returns the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.
.getMonth() 1/8/2020
.getTime()

{% code title="Timestamp math" %}

var second = 1000;
var minute = 1000 * 60;
var hour = 1000 * 60 * 60;
var day = 1000 * 60 * 60 * 24;
var week = 1000 * 60 * 60 * 24 * 7;
var year = 1000 * 60 * 60 * 24 * 7 * 52;

//Multiply the number of time units you want by the formula above.
//For example, to jump 11 hours in the future or past
//you would multiply the hour numbers above by 11.

{% endcode %}

libraries
https://momentjs.com/ 10/19