note 54478 added to function.date

From: Date: Tue, 05 Jul 2005 19:42:53 +0000
Subject: note 54478 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-91487@lists.php.net to get a copy of this message
Creating intervals for your database by using a existing date stamp and adding a interval to the existing date and write it to the database. You can add dates to the existing date by just changing the interval day. $datetime is a field in the database as well as $expire. So both will be in the database fields. Hope this script helps ;-) The script I use is as follows: // # Timestamp starts for beginning subscriptions // $datetime = date("Y-m-d G:i "); // # Timestamp ends for beginning subscription // // # Timestamp starts for end subscriptions // $n_start_date = "".time();; // # The following line can be changed for how long you would like your timestamp to take place. $squery = "SELECT DATE_ADD(FROM_UNIXTIME($n_start_date), INTERVAL 14 DAY)"; $nresult = mysql_query($squery); $s_new_date = mysql_result($nresult, 0, 0); // Free the result mysql_free_result($nresult); // Disconnected mysql_close($ndbconn); $expire = "$s_new_date"; // # Timestamp ends for end subscription // ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54478 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54478&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54478&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54478&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54478&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54478&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54478&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54478&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91487) next »