Formatting the Date in JavaScript

前端 未结 6 1688
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-16 06:54

Using newDate() function in Java script, I am able to get today\'s date. I am getting the date in the format 3/3/2009 (d/m/yyyy). But i actually need the date in the format

6条回答
  •  忘掉有多难
    2021-01-16 07:23

    Just another option, which I wrote:

    DP_DateExtensions Library

    Not sure if it'll help, but I've found it useful in several projects.

    Supports date/time formatting, date math (add/subtract date parts), date compare, date parsing, etc. It's liberally open sourced.

    No reason to consider it if you're already using a framework (they're all capable), but if you just need to quickly add date manipulation to a project give it a chance.

提交回复
热议问题