Login   /   Register

Tomorrow and Yesterday’s dates

Rate this article
     0 votes, average: 0 out of 50 votes, average: 0 out of 50 votes, average: 0 out of 50 votes, average: 0 out of 50 votes, average: 0 out of 5
Loading ... Loading ...
March 31st, 2008 by daniva

what if you want to retrieve today’s date?

MsgBox Date()

But what about yesterday’s date? it’s just as easy to determine yesterday’s date as it is today’s date.
That’s because VBScript can do date arithmetic: give it today’s date, and then you can simply subtract 1 day to determine yesterday’s date. In other words:

MsgBox Date() - 1

Want to know tomorrow’s date?

MsgBox Date() + 1

Based on " How Can I Get Yesterday’s Date?" from the Scripting Guys.

Posted in VBScript

Leave a Reply

You must be logged in to post a comment.

This article was viewed 413 times