[removed] output current datetime in YYYY/mm/dd hh:m:sec format

后端 未结 6 694
囚心锁ツ
囚心锁ツ 2020-11-30 08:21

I need to output the current UTC datetime as a string with the following format:
YYYY/mm/dd hh:m:sec

How do I achieve that with Javascript?

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-30 08:58

    With jQuery date format :

    $.format.date(new Date(), 'yyyy/MM/dd HH:mm:ss');
    

    https://github.com/phstc/jquery-dateFormat

    Enjoy

提交回复
热议问题