How to insert today's date into a URL?

后端 未结 6 512
陌清茗
陌清茗 2020-12-11 23:11

I have a url that change every day based on today\'s date, for example:

http://www.newspaper.com/edition/20141227.ht         


        
6条回答
  •  悲哀的现实
    2020-12-11 23:32

     var date = new Date().toDateString("yyyyMMdd");
    

    then paste the date in building the URL

    url = "http://blahblahblaj.com/"+date

提交回复
热议问题