
fashimpaur
User
/ Moderator
Feb 14, 2002, 2:15 PM
Post #2 of 2
(238 views)
|
|
Re: [benchivers] Date Function
[In reply to]
|
Can't Post
|
|
Benchivers, Here is a code example: $time = time; $time += 180 * 24 * 60 * 60; $nowplus180days = localtime($time); print ($nowplus180days); time() returns the current time in seconds since epoch (Jan 1, 1970 at 00:00:00) The second line adds the number of seconds desired to be added to it. Storing the result of localtime in a scalar gets a nicely formatted date string. Then we printed it. (Note, if you run this today, the date returned is an hour ahead [at least in US CST]. This is because the Daylight Savings Time is in effect on that date and clocks are set ahead one hour. It is not an error.) HTH, Dennis $a="c323745335d3221214b364d545". "a362532582521254c3640504c3729". "2f493759214b3635554c3040606a0", print unpack"u*",pack "h*",$a,"\n\n";
|