🌐
GitHub
github.com › datejs › Datejs
GitHub - datejs/Datejs: A JavaScript Date and Time Library · GitHub
Date.today().moveToLastDayOfMonth() // Returns the last day of the current month. new Date().clearTime() // Sets the time to 00:00 (start of the day). Date.today().setTimeToNow() // Resets the time to the current time (now).
Starred by 1.9K users
Forked by 474 users
Languages   JavaScript 97.7% | HTML 1.8% | CSS 0.5%
🌐
GitHub
github.com › date-fns › date-fns
GitHub - date-fns/date-fns: ⏳ Modern JavaScript date utility library ⌛️
TypeScript: The library is 100% TypeScript with brand-new handcrafted types. I18n: Dozens of locales. Include only what you need. ... import { compareAsc, format } from "date-fns"; format(new Date(2014, 1, 11), "yyyy-MM-dd"); //=> '2014-02-11' const dates = [ new Date(1995, 6, 2), new Date(1987, 1, 11), new Date(1989, 6, 10), ]; dates.sort(compareAsc); //=> [ // Wed Feb 11 1987 00:00:00, // Mon Jul 10 1989 00:00:00, // Sun Jul 02 1995 00:00:00 // ]
Starred by 36.5K users
Forked by 1.9K users
Languages   TypeScript
🌐
WebPlatform
webplatform.github.io › docs › javascript › Date › now
now · WebPlatform Docs
Notice: The WebPlatform project, ... javascript · Date · now · Gets the current date and time. Date.now() The number of milliseconds between midnight, January 1, 1970, and the current date and time....
🌐
GitHub
github.com › knowledgecode › date-and-time
GitHub - knowledgecode/date-and-time: The simplest, most intuitive date and time library · GitHub
const { format } = require('date-and-time'); format(new Date(), 'ddd, MMM DD YYYY'); // => Wed, Jul 09 2025 · Version 4.x has been completely rewritten in TypeScript and some features from 3.x are no longer compatible.
Starred by 189 users
Forked by 42 users
Languages   TypeScript 99.1% | JavaScript 0.9%
🌐
GitHub
gist.github.com › Ivlyth › c4921735812dd2c0217a
format javascript date to format "YYYY-mm-dd HH:MM:SS" · GitHub
function NOW() { var date = new Date(); var aaaa = date.getUTCFullYear(); var gg = date.getUTCDate(); var mm = (date.getUTCMonth() + 1); if (gg < 10) gg = "0" + gg; if (mm < 10) mm = "0" + mm; var cur_day = aaaa + "-" + mm + "-" + gg; var hours ...
🌐
date-fns
date-fns.org
date-fns - modern JavaScript date utility library
date-fns provides the most comprehensive yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js.
🌐
GitHub
github.com › catamphetamine › javascript-time-ago
GitHub - catamphetamine/javascript-time-ago: International highly customizable relative date/time formatting
<!-- Example `[version]`: `2.x` --> <script src="https://unpkg.com/javascript-time-ago@[version]/bundle/javascript-time-ago.js"></script> <script> TimeAgo.addDefaultLocale({ locale: 'en', now: { now: { current: "now", future: "in a moment", past: "just now" } }, long: { year: { past: { one: "{0} year ago", other: "{0} years ago" }, future: { one: "in {0} year", other: "in {0} years" } }, ... } }) </script> <script> alert(new TimeAgo('en-US').format(new Date())) </script>
Starred by 373 users
Forked by 33 users
Languages   JavaScript 100.0% | JavaScript 100.0%
🌐
GitHub
github.com › jacwright › date.format
GitHub - jacwright/date.format: A JavaScript date format library that uses the same method as PHP's date() function.
2. Include the script: <script src="date.format.js"></script> Escaping letters can be done by typing \\ in front of a letter. var myDate = new Date(); alert(myDate.format('d-m-Y')); // Outputs "26-11-2017" alert(myDate.format('d-m-Y H:i:s')); ...
Starred by 251 users
Forked by 116 users
Languages   JavaScript 100.0% | JavaScript 100.0%
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › Date
Date() constructor - JavaScript | MDN
console.log(new Date(["2020-06-19", "17:13"])); // 2020-06-19T17:13:00.000Z in Chrome, since it recognizes "2020-06-19,17:13" // "Invalid Date" in Firefox ... This page was last modified on Jul 10, 2025 by MDN contributors. View this page on GitHub • Report a problem with this content
Find elsewhere
🌐
JavaScripture
javascripture.com › Date
Date JavaScript API
JavaScripture · Contribute via ... number of milliseconds since 01 January, 1970 UTC. Use new Date() to get a Date for the current time or Date.now() to get the current time in milliseconds since 01 January, 1970 UTC....
🌐
GitHub
github.com › wanasit › chrono
GitHub - wanasit/chrono: A natural language date parser in Javascript · GitHub
The method must return an array of the new results (which, in this case, we modified those results in place). Checkout the Typescript Documentation in the project's Github page. This guide explains how to set up chrono project for prospective contributors. # Clone and install library $ git clone https://github.com/wanasit/chrono.git chrono $ cd chrono $ npm install · Parsing date from text is complicated.
Starred by 5.2K users
Forked by 370 users
Languages   TypeScript
🌐
GitHub
gist.github.com › drodsou › 65ad2cf874ee0057f6fa7c78f6ad4c7d
Javascript date related · GitHub
https://medium.com/@toastui/handling-time-zone-in-javascript-547e67aa842d · Current date and time of browser's timezone, in ISO format: new Date(Date.now() - (new Date().getTimezoneOffset() * 60000)).toISOString(); date object of UTC Time (not ...
🌐
GitHub
github.com › boblauer › MockDate
GitHub - boblauer/MockDate: A JavaScript Mock Date object that can be used to change when "now" is. · GitHub
Will restore the original Date object back to the native implementation. MockDate.set('2000-11-22'); new Date().toString() // "Tue Nov 21 2000 18:00:00 GMT-0600 (CST)" MockDate.set('1/30/2000'); new Date().toString() // "Sun Jan 30 2000 00:00:00 GMT-0600 (CST)" MockDate.set(new Date('2/20/2000')); new Date().toString() // "Sun Feb 20 2000 00:00:00 GMT-0600 (CST)" MockDate.set(moment('3/30/2000').toDate()); // using momentjs new Date().toString() // "Thu Mar 30 2000 00:00:00 GMT-0600 (CST)" MockDate.reset(); new Date().toString() // "Mon Mar 17 2014 18:08:44 GMT-0500 (CDT)"
Starred by 679 users
Forked by 53 users
Languages   JavaScript 65.8% | TypeScript 34.2%
🌐
GitHub
github.com › iamkun › dayjs
GitHub - iamkun/dayjs: ⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API
⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API - iamkun/dayjs
Starred by 48.6K users
Forked by 2.4K users
Languages   JavaScript
🌐
GitHub
github.com › moment › luxon
GitHub - moment/luxon: ⏱ A library for working with dates and times in JS
Luxon is a library for working with dates and times in JavaScript. DateTime.now().setZone("America/New_York").minus({ weeks: 1 }).endOf("day").toISO();
Starred by 16.4K users
Forked by 768 users
Languages   JavaScript
🌐
GitHub
gist.github.com › miguelmota › 5b67e03845d840c949c4
Random date in JavaScript · GitHub
You get the number of miliseconds between end and start dates. ... You add the result to the number of miliseconds from the start.getTime(). The result of this operation can be the same as start.getTime() (if Math.random() is zero) but it cannot be greater than end.getTime() because you multiply the difference by Math.random that is less than 1. (I do not know if it can be equal end.getTime() because I do not know the "scale" of roundings) You use the result as the parameter for "new Date(our result)" constructor that accepts number of milliseconds since January 1, 1970 00:00:00 UTC and uses it to create the date object.
🌐
GitHub
github.com › matthewmueller › date
GitHub - matthewmueller/date: Date() for humans
date('10 minutes from now') date('in 5 hours') date('at 5pm') date('at 12:30') date('at 23:35') date('in 2 days') date('tuesday at 9am') date('monday at 1:00am') date('last monday at 1:00am') date('tomorrow at 3pm') date('yesterday at 12:30am') date('5pm tonight') date('tomorrow at noon') date('next week tuesday') date('next week tuesday at 4:30pm') date('2 weeks from wednesday') date('tomorrow night at 9') date('tomorrow afternoon') date('this morning at 9') date('at 12:30pm') date('tomorrow at 9 in the morning') date('2 years from yesterday at 5pm') date('last month') date('2nd of January')
Starred by 1.5K users
Forked by 88 users
Languages   JavaScript 99.5% | Makefile 0.5% | JavaScript 99.5% | Makefile 0.5%
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › now
Date.now() - JavaScript | MDN
const start = Date.now(); doSomeLongRunningProcess(); console.log(`Time elapsed: ${Date.now() - start} ms`); For more complex scenarios, you may want to use the performance API instead. ... This page was last modified on Jul 10, 2025 by MDN contributors. View this page on GitHub • Report ...