WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Time - Timer and Date Functions
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Get Previous Day of Week


#DefineFunction udfGetSaturdayOfWeek (YmdHms) ; Returns datetime string. Leaves Hms untouched.
	Return (TimeSubtract(YmdHms,StrCat("0000:00:",(TimeJulianDay(YmdHms)+6) mod 7)))
#EndFunction

#DefineFunction udfGetSundayOfWeek (YmdHms) ; Returns datetime string. Leaves Hms untouched.
	Return (TimeSubtract(YmdHms,StrCat("0000:00:",(TimeJulianDay(YmdHms)+5) mod 7)))
#EndFunction

Message("Previous Saturday was", udfGetSaturdayOfWeek (TimeYmdHms()))

Message("Previous Sunday was", udfGetSundayOfWeek (TimeYmdHms()))

Article ID:   W16728
File Created: 2005:02:18:12:22:04
Last Updated: 2005:02:18:12:22:04