Page 1 of 1

date() & time()

Posted: Sun Jun 20, 2004 7:57 am
by pelegk2
what execlly does the second part of the date() means :

Code: Select all

date("m/d/y 23:59:59",time()+60 * 60 * 24)
thnaks in advance
peleg

its in the manual but...

Posted: Sun Jun 20, 2004 9:02 am
by burzvingion

Code: Select all

date($format, $timestamp)
$format is a string with how you want the date to be returned. I think you know that

$timestamp in a unix timestamp of the date you want. to return today's date you can leave off this parameter. you'll prolly want to use mktime() to make a timestamp to use here.

All this is in the php manual with plenty of examples. I suggest going there first before you ask it on a forum from now on. (exact page in manual: http://us4.php.net/manual/en/function.date.php)

glad i could help tho,
Ben

Posted: Sun Jun 20, 2004 10:09 am
by Buddha443556
It means from the time when executed plus 24 hours (60 sec times 60 = one hour, times 24 equals 24 hours).

Posted: Mon Jun 21, 2004 1:44 am
by pelegk2
yesi understand all of this i just asked how the date() function combines the
$format with $timestamp

Posted: Mon Jun 21, 2004 2:58 am
by Grim...
It gives you the date for the time you specify.

Posted: Mon Jun 21, 2004 4:25 pm
by pickle
The $timestamp is, of course, a UNIX timestamp representing the number of seconds since the UNIX epoch. $format is a string of characters - some of which are special, and applies that string to the timestamp. So, for date(), 'Y' stands for a 4 digit year. So, date('Y',time()) will give you the current year.

[php_man]date()[/php_man]

Posted: Sun Jun 27, 2004 12:11 am
by pelegk2
ok thnaks all of u