Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • 3
    @kpull1 the asker did not restrict the solution domain by asking if a built-in solution exists. Commented Oct 30, 2014 at 16:15
  • 6
    Modern note: Moment.js is incredibly heavy to add for such a small purpose. It's several hundred KB, and isn't webpack-friendly out of the box. Commented Nov 25, 2016 at 13:24
  • 3
    Our preferred library is date-fns. Webpack-friendly, fast, and treats Dates as immutable. Commented Jun 6, 2017 at 20:59
  • 1
    @LukeWilliams never heard of date-fns until now. will check it out. thanks. Commented Jun 6, 2017 at 21:23
  • 2
    @JoshuaComeau If you download it from cdnjs.cloudflare.com/ajax/libs/moment.js/2.19.3/moment.min.js, it takes up 53,248 bytes on disk. I imagine that's the whole ball o' wax, but I don't know. Anyway, whatever. It's not a big deal. Commented Dec 4, 2017 at 18:53