LPM: Test / question on date stuff

David Hempy hempy at ket.org
Wed Feb 9 13:18:09 CST 2000


At 07:33 AM 2/9/2000 -0800, you wrote:

>It of course returns the date just like I want it
>(02/09/2000).  So what code do I issue to get 28 days
>from now added onto the day and get the correct
>rollaround. (ie when you add 28 above you get Feb 37th
>-ugg instead of the early part of March).  Any help
>would be appreciated and go toward good karma.
>

time is expressed in seconds since the epoch.  You can adjust a time (which
is actually date and time) by adding/subtracting seconds.

There are 86400 seconds in a day (60*60*24).

This code will increment a time by 28 days:

	$mytime = time();
	$mytime += 28 * 86400;

Hope this helps,
-dave


--
David Hempy
Internet Database Administrator
Kentucky Educational Television




More information about the Lexington-pm mailing list