Re: mktime ()

From: Date: Sun, 17 Oct 2004 23:59:12 +0000
Subject: Re: mktime ()
References: 1  Groups: php.install 
Request: Send a blank email to php-install+get-14540@lists.php.net to get a copy of this message
Scott Hamm wrote:
I'm trying to understand how mktime() function works. I've tried as follows: <? mktime($one,$two,$three,$four,$five,$six); echo "<p>$one $two $three $four $five $six</p>\n"; ?> What am I doing wrong? Hi Scott,
mktime() creates a UNIX timestamp based on the arguments you give it ($hour, $minute, $second, $month, $day, $year, $is_dst) where $is_dst is a flag for daylight savings time, you can set it to 1 if the time is during daylight savings, 0 if not and -1 (the default) if you don't know (php will try to work it out). So for eg if you want the timestamp for January 21st, 2004 at 12:30pm and 20 seconds you would do this: <?php $time = mktime(12, 30, 20, 1, 21, 2004); echo $time; ?> Hope this helps... Cheers, Brad -- |> Brad Kowalczyk |> Web Developer |> brad@ibiscode.com |> www.ibiscode.com

Attachment: [application/x-pkcs7-signature] S/MIME Cryptographic Signature smime.p7s
« previous php.install (#14540) next »