How to get current date in jquery?

前端 未结 30 1882
春和景丽
春和景丽 2020-11-27 09:51

I want to know how to use the Date() function in jQuery to get the current date in a yyyy/mm/dd format.

30条回答
  •  野性不改
    2020-11-27 10:14

    Using the jQuery-ui datepicker, it has a handy date conversion routine built in so you can format dates:

    var my_date_string = $.datepicker.formatDate( "yy-mm-dd",  new Date() );
    

    Simple.

提交回复
热议问题