Ask a Question related to PHP Development, Design and Development.
-
Patrick Lee Humphrey #1
Re: HELP: variable increment based on date
Koncept <user@unknown.invalid> writes:
>I have a variable $days which is a counter to track days since an event
>start. What I wish to do is increment this variable by on, once a day
>if it is after 12:00am and echo this number. Any suggestions?Try this: (assuming the event happened September 1st)>Thanks.
$start = mktime (0,0,0,9,1,2004);
$now = time();
$days = floor (($now - $start) / 86400);
That should produce $days as an integer that will increase by one at midnight.
--
Patrick "The Chief Instigator" Humphrey (patrick@io.com) Houston, Texas
[url]www.chiefinstigator.us.tt/aeros.php[/url] (TCI's 2003-04 Houston Aeros)
Patrick Lee Humphrey Guest
-
session variable increment problem
session_start(); $_SESSION++; print 'You have visited here '.$_SESSION.' times.'; why the visit variable is not incremented the next time i... -
date query problem, date in variable
I am using the following query : $query_archief = "SELECT * FROM vacatures where dd_eind_plaatsing < $dd_eind_plaatsing_archief1" note:... -
Display name based on date
Hi All, I am trying to put together a cfm page that will display a users name based on the day of the week. The user selects a range of dates that... -
How do I manipulate a date variable to a specific date array?
Hi, I use the getdate() function to return today's date in an array. I do this as I need to separate the day/month/year as to display them in a... -
If statement based on current date
I tried the code below and after adjusting it to get around some syntax errors I got nothing. It just runs the queries without even considering...



Reply With Quote

