Using DateTime.DateFormat = "yyyyMMdd" I need to get todays date and yesterdays date.
log (DateTime.DateFormat = "yyyyMMdd")
Gives me 20130827 which is correct.
However while using the same dateFormat...
Tmpdate = DateTime.Add(DateTime.Now, 0, 0, -1)
Log(tmpdate)
gives me 1377498127481 but I expected 20130826
I would like to keep this simple with a few lines of code and not add any libraries such as DateUtils.
log (DateTime.DateFormat = "yyyyMMdd")
Gives me 20130827 which is correct.
However while using the same dateFormat...
Tmpdate = DateTime.Add(DateTime.Now, 0, 0, -1)
Log(tmpdate)
gives me 1377498127481 but I expected 20130826
I would like to keep this simple with a few lines of code and not add any libraries such as DateUtils.