print("Getting previous date") var yourPrevDay = 5 // Your desired day var d = new Date(new Date().setDate(new Date().getDate()- yourPrevDay)) print(d)
Getting previous date Thu May 31 2018 05:20:06 GMT+0200 (CEST)
No comments:
Post a Comment