Friday, 19 April 2013

PHP Date()


PHP Date ()

PHP function Date ().
d - day / date.
m - month.
y - years.

EXAMPLE:
date ("Y / m / d"). '<br />';
date ("Y.m.d"). '<br />';
date ('Y-m-d ");

RESULTS:
05/04/2010
05/04/2010
2010-5-4

PHP Function Date with Timestamp.
Timestamp is useful to bring a day other than today, typically used on websites that provide term users aware of them, for example if the user they do not make a payment on the day that have been agreed then their accounts could not be used.

syntax:
mktime (hour, minute, second, month, day, the date, limit)

EXAMPLE:
<? php
$ tomorrow = mktime (0,0,0, date ("m"), date ("d") +1, date ("Y"));
echo "Tomorrow." date ("Y / m / d", $ tomorrow);
?>

No comments:

Post a Comment