Home  >  Q&A  >  body text

Js中怎么获取当前年份、月份和日期?

小天小天2883 days ago987

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-09-30 23:12:15

    How to get the current year, month and date in Js? - PHP Chinese website Q&A - How to get the current year, month and date in Js? - PHP Chinese website Q&A

    Take a look around and learn.

    reply
    0
  • 迷茫

    迷茫2016-12-20 15:20:44

    var myDate = new Date( );

    myDate.getFullYear(); //获取完整的年份(4位,1970-????)

    myDate.getMonth(); //获取当前月份(0-11,0代表1月)

    myDate.getDate(); //获取当前日(1-31)


    reply
    0
  • Cancelreply