Re: mktime and variables not working
| From: | George Nicolae | Date: | Thu, 03 Jan 2002 15:23:50 +0000 |
| Subject: | Re: mktime and variables not working | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79327@lists.php.net to get a copy of this message | ||
mktime have the folloing format int mktime (int hour, int minute, int
second, int month, int day, int year)
I don't understand what represent $x[stop]. maybe time in hh:mm:ss format?
if is that you ca use
$reformat_stop=explode(":",$x[stop].":"."1:1:2001")
stop=mktime($reformat_stop[0],$reformat_stop[1],$reformat_stop[2],$reformat_
stop[3],$reformat_stop[4],$reformat_stop[5])
be careful $stop is a timpstamp and you must use in combination with date()
function. look in manual for more details about function date();
--
Best regards,
George Nicolae
IT Manager
___________________
X-Playin - Professional Web Design
www.x-playin.f2s.com
"Tom Beidler" <tom@orbittechservices.com> wrote in message
news:B859B092.33D1%tom@orbittechservices.com...
> I'm trying to calculate elapsed time and I'm having trouble using mktime
> with variables. Here's my code;
>
>
> $reformat_stop = str_replace(":", ",", $x[stop]) . ",1,1,2002";
> $stop=mktime($reformat_stop);
>
> I don't know how to format the code for mktime to use a variable. I keep
> getting -1 for $stop but if I hard code a value in mktime it works fine.
>
>