How to get Yesterday's date?



Hi all,

I’d like to ask if anyone is aware of a simple solution to get yesterday’s date.

So far I’ve been able to split a DateString into three variables to compile them in the following format: “”

It looks something like this:

  • Day: DateString.ElementAtOrDefault(3) + DateString.ElementAtOrDefault(4)
  • Month: DateString.Remove(2)
  • Year: DateString.ElementAtOrDefault(6) + DateString.ElementAtOrDefault(7) + DateString.ElementAtOrDefault(8) + DateString.ElementAtOrDefault(9)

My date variable then consists of:

  • Day + “.” + Month + “.” + Year

The problem I’m currently facing is in finding an easy way to also get yesterday’s date in the same format.

Any ideas?

How to calculate next day from a date input variable?

Did you try





In assign use System.DateAdd(“d”,-1,(System.DateTime.Today))

DateAdd is the VB function which used to increase or decrease date or time.

For more information on DateAdd click this link:


Thank you! this solved my issue in a much easier fashion!


How to add date and time?