Page 1 of 1

Get previous days Date

Posted: Mon Apr 07, 2008 5:36 am
by CitrixDude
Does anyone have guidance on how to get the previous days date, naturally this would be in a vbscript? I would need the year, month, and day in UTC format.
Any help or pointers to other resources would be great!

Get previous days Date

Posted: Mon Apr 07, 2008 5:40 am
by donj
BTW, DateAdd can add/subtract (by adding a negative number) a day, month, year, hour, or whatever - http://www.w3schools.com/Vbscript/func_dateadd.asp for docs.

Get previous days Date

Posted: Mon Apr 07, 2008 6:46 am
by donj
LOL... Seattle, Chicago.. ya, very warm...

Get previous days Date

Posted: Mon Apr 07, 2008 7:18 am
by donj
They DO allow it. I just don't get to do it much. I have a conference next month in Orlando, though, so am going a couple days early for a bit of a break.

Get previous days Date

Posted: Sat Apr 12, 2008 12:24 am
by abqbill
Hi CitrixDude,I know you mentioned VBScript, but this is really easy in JScript:

Code: Select all

var d = new Date(new Date().getTime() - 86400 * 1000);
JScript's dates are all UTC, so it makes things really easy.Bill