Timeline for How do I get the current date in JavaScript?
Current License: CC BY-SA 4.0
98 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 3, 2024 at 7:46 | answer | added | I.sh. | timeline score: 1 | |
| Jan 31, 2024 at 7:56 | answer | added | mdcq | timeline score: 0 | |
| Nov 30, 2023 at 21:58 | answer | added | Rahul | timeline score: 1 | |
| Sep 13, 2022 at 9:20 | answer | added | allenyllee | timeline score: 1 | |
| Jul 8, 2022 at 11:44 | answer | added | Jorge | timeline score: -5 | |
| May 25, 2022 at 13:39 | comment | added | Lars Flieger | Luxon is a modern library from one of the momentjs developers. Really nice interface and APIs! | |
| May 18, 2022 at 2:18 | answer | added | SarjanWebDev | timeline score: 5 | |
| Mar 7, 2022 at 1:51 | answer | added | addlistener | timeline score: 0 | |
| Nov 3, 2021 at 19:27 | answer | added | Parking Master | timeline score: 1 | |
| Jun 8, 2021 at 14:23 | comment | added | Przemek Nowicki | new Date() is still valid and best answer but after that the need of particular format comes up and I would suggest to use toLocaleDateString with new Date e.g. new Date().toLocaleDateString('en-GB', {year: "numeric", month: "2-digit", day: "2-digit"})which in the end give you formatted current date in this format 08/06/2021. | |
| May 14, 2021 at 16:51 | answer | added | Mansour Alnasser | timeline score: 0 | |
| May 11, 2021 at 14:33 | answer | added | Force Bolt | timeline score: 8 | |
| Feb 8, 2021 at 6:12 | answer | added | Shubham Chadokar | timeline score: 53 | |
| Jan 14, 2021 at 23:51 | history | edited | Rob Bednark | CC BY-SA 4.0 | fixed grammar |
| Jan 11, 2021 at 15:29 | answer | added | IonicMan | timeline score: 5 | |
| Dec 5, 2020 at 18:17 | review | Suggested edits | |||
| Dec 6, 2020 at 6:38 | |||||
| Nov 14, 2020 at 6:41 | history | notice added | Cody Gray♦ | Needs detailed answers | |
| Oct 8, 2020 at 19:34 | answer | added | Constantin | timeline score: 22 | |
| Aug 2, 2020 at 11:21 | answer | added | Yanir Calisar | timeline score: -2 | |
| Apr 9, 2020 at 7:26 | answer | added | SpaceX | timeline score: 0 | |
| Mar 3, 2020 at 13:02 | history | edited | Kamil Kiełczewski | edited tags | |
| Mar 3, 2020 at 13:00 | answer | added | Kamil Kiełczewski | timeline score: 13 | |
| Feb 18, 2020 at 16:46 | answer | added | Caiuby Freitas | timeline score: 10 | |
| Feb 9, 2020 at 18:39 | answer | added | Consta Gorgan | timeline score: 4 | |
| Feb 5, 2020 at 11:14 | answer | added | Ashish Pathak | timeline score: -1 | |
| Nov 7, 2019 at 20:00 | answer | added | Adrian Bartholomew | timeline score: 0 | |
| Nov 7, 2019 at 16:34 | answer | added | agDev | timeline score: 1 | |
| Oct 24, 2019 at 10:21 | answer | added | JeromeH | timeline score: -1 | |
| Aug 1, 2019 at 10:13 | answer | added | anil shrestha | timeline score: 8 | |
| Jul 11, 2019 at 8:00 | answer | added | Yugandhar Chaudhari | timeline score: 12 | |
| May 9, 2019 at 16:38 | answer | added | Alex Ivasyuv | timeline score: 0 | |
| Jan 23, 2019 at 16:14 | answer | added | alain.janinm | timeline score: 1 | |
| Jan 8, 2019 at 0:33 | answer | added | Harry Bosh | timeline score: 8 | |
| Nov 6, 2018 at 10:55 | answer | added | jyotibisht | timeline score: 2 | |
| Sep 19, 2018 at 9:14 | comment | added | bbsimonbb | Your question is very broad! Do you want a string (easy) or a date object (traps)? Do you want the current date where you are, or in London, or somewhere else? BEWARE THE TIMEZONE | |
| S Jul 25, 2018 at 21:35 | history | suggested | FullStackDeveloper | This question is asking about date only. | |
| Jul 25, 2018 at 18:06 | review | Suggested edits | |||
| S Jul 25, 2018 at 21:35 | |||||
| May 18, 2018 at 7:27 | answer | added | jafarbtech | timeline score: 17 | |
| Apr 15, 2018 at 23:05 | history | edited | John Slegers | edited tags | |
| Mar 10, 2018 at 14:48 | answer | added | Aung Htet | timeline score: 34 | |
| Dec 2, 2017 at 15:11 | comment | added | Freewalker | Surprised to not see a comment about the great date-fns library. Modular (just import what you need), treats Dates as immutable, work with native Date objects, faster than Moment. | |
| Dec 1, 2017 at 21:43 | answer | added | Blair Anderson | timeline score: 16 | |
| May 10, 2017 at 19:30 | answer | added | Yergalem | timeline score: 1 | |
| Feb 1, 2017 at 11:50 | answer | added | Souvik | timeline score: 7 | |
| Jan 20, 2017 at 12:35 | answer | added | Cam | timeline score: 11 | |
| Jan 10, 2017 at 19:59 | history | edited | Peter Mortensen | CC BY-SA 3.0 | Copy edited. |
| Dec 21, 2016 at 13:23 | comment | added | Benj | See this post : stackoverflow.com/a/30245911/1579667 | |
| Aug 17, 2016 at 8:33 | answer | added | Jayant Patil | timeline score: 4 | |
| Jul 18, 2016 at 17:15 | answer | added | Oded Breiner | timeline score: 51 | |
| May 3, 2016 at 22:14 | answer | added | Ronnie Smith | timeline score: 2 | |
| Mar 27, 2016 at 5:15 | vote | accept | Suresh | ||
| Mar 27, 2016 at 5:15 | vote | accept | Suresh | ||
| Mar 27, 2016 at 5:15 | |||||
| Mar 10, 2016 at 16:30 | answer | added | Damjan Pavlica | timeline score: 479 | |
| Feb 3, 2016 at 12:08 | answer | added | Isaievskyi_Serhii | timeline score: 15 | |
| Jan 24, 2016 at 20:41 | answer | added | John Slegers | timeline score: 2 | |
| Dec 24, 2015 at 13:28 | vote | accept | Suresh | ||
| Mar 27, 2016 at 5:15 | |||||
| Dec 22, 2015 at 18:14 | comment | added | Suncat2000 | @SteveBennett Actually, it returns the current date and time. JavaScript doesn't have separate objects to represent a date-only value or a time-only value. It has only Date, which incorporates both. So, even if the question isn't exactly clear, the expected answer is to obtain the current system date and time, which is exactly what new Date() returns, so +1 to @Hendrik for the most concise answer. | |
| Dec 22, 2015 at 17:30 | comment | added | RBoschini | use momentJs, this lib is gold for developers. | |
| Dec 5, 2015 at 9:47 | vote | accept | Suresh | ||
| Dec 5, 2015 at 9:47 | |||||
| Oct 31, 2015 at 19:39 | answer | added | ISONecroMAn | timeline score: 5 | |
| Oct 1, 2015 at 16:19 | answer | added | Toucouleur | timeline score: 14 | |
| Oct 1, 2015 at 15:25 | answer | added | marverix | timeline score: 8 | |
| Aug 11, 2015 at 6:31 | answer | added | Akhil | timeline score: 9 | |
| Aug 11, 2015 at 6:08 | answer | added | user1338062 | timeline score: 21 | |
| Jun 30, 2015 at 8:10 | answer | added | Phil Ricketts | timeline score: 13 | |
| Jun 1, 2015 at 15:40 | answer | added | Andrew | timeline score: 4 | |
| May 15, 2015 at 14:40 | answer | added | Jose Rojas | timeline score: 21 | |
| May 7, 2015 at 9:37 | review | Close votes | |||
| May 11, 2015 at 0:04 | |||||
| Apr 12, 2015 at 14:36 | answer | added | Jas | timeline score: 5 | |
| Apr 12, 2015 at 1:01 | comment | added | Steve Bennett | new Date() returns the current time, not the current date. The distinction matters if you're trying to compare it against another date which doesn't have a time component (ie, is at midnight). | |
| Feb 10, 2015 at 15:03 | answer | added | Fannon | timeline score: 3 | |
| Jan 19, 2015 at 22:21 | answer | added | Brock Davis | timeline score: 3 | |
| Sep 4, 2014 at 12:11 | vote | accept | Suresh | ||
| Dec 5, 2015 at 9:47 | |||||
| Sep 4, 2014 at 12:11 | vote | accept | Suresh | ||
| Sep 4, 2014 at 12:11 | |||||
| Sep 2, 2014 at 6:14 | answer | added | Marshal | timeline score: 235 | |
| Aug 16, 2014 at 11:56 | answer | added | Morad | timeline score: 63 | |
| Jul 9, 2014 at 7:01 | answer | added | Dunaevsky Maxim | timeline score: 69 | |
| May 30, 2014 at 5:55 | review | Suggested edits | |||
| May 30, 2014 at 5:56 | |||||
| Apr 22, 2014 at 9:24 | answer | added | Andrea | timeline score: 1 | |
| Mar 27, 2014 at 9:35 | history | edited | Himanshu | CC BY-SA 3.0 | edited tags |
| Nov 3, 2013 at 18:03 | answer | added | roshan | timeline score: 52 | |
| Sep 29, 2013 at 14:13 | answer | added | Varun Natraaj | timeline score: 547 | |
| Jun 28, 2013 at 22:32 | answer | added | Rishabh | timeline score: 58 | |
| Feb 8, 2013 at 12:07 | answer | added | Roger | timeline score: 8 | |
| Dec 12, 2012 at 1:03 | answer | added | benjamin.keen | timeline score: 69 | |
| Jul 2, 2012 at 19:23 | history | edited | saluce | CC BY-SA 3.0 | added 2 characters in body |
| Jun 26, 2012 at 13:00 | answer | added | eomeroff | timeline score: 25 | |
| Feb 15, 2012 at 8:48 | answer | added | Jimmy M | timeline score: 121 | |
| Feb 12, 2012 at 7:54 | history | protected | casperOne | ||
| Feb 10, 2012 at 14:33 | answer | added | SpYk3HH | timeline score: 283 | |
| Dec 23, 2011 at 19:54 | history | edited | Bakudan | CC BY-SA 3.0 | edited body; edited title |
| Dec 1, 2011 at 4:34 | comment | added | user1017788 | this would help you tizag.com/javascriptT/javascriptdate.php | |
| Mar 20, 2011 at 11:30 | vote | accept | Suresh | ||
| Sep 4, 2014 at 12:11 | |||||
| Feb 8, 2011 at 4:42 | answer | added | Samuel Meddows | timeline score: 3465 | |
| Oct 7, 2009 at 11:57 | history | edited | Chii | CC BY-SA 2.5 | edited title |
| Oct 7, 2009 at 11:40 | comment | added | Quentin | See the documentation for the Date object. It has examples. | |
| Oct 7, 2009 at 11:39 | comment | added | Hendrik | var currentTime = new Date(); | |
| Oct 7, 2009 at 11:39 | history | asked | Suresh | CC BY-SA 2.5 |