[thelist] Difference in time

Means, Eric D eric.d.means at boeing.com
Wed Oct 2 12:49:01 CDT 2002


-----Original Message-----
From: wade [mailto:wade at bayou.com]
Sent: Wednesday, October 02, 2002 12:32 PM
To: thelist at lists.evolt.org
Subject: [thelist] Difference in time

> I was trying to use the mktime( ) function but it keeps giving me these
> results.(( 1033578795 )) The last few
> numbers change but the first few (that as suppose to be the hour) does
> not change?

mktime() returns the time in Unix format (seconds since midnight, Jan 1
1970).  That's why only the last few digits are changing.

> I want to be able to say if 1 hour has passed from the time .. mktime( )
> .. that is stored in the db they can vote once again. This also has to
> account that if someone goes to the poll tomorrow at the same time (same
> hour) the script knows it's a different hour and different day.

Do the following:
Subtract the value from the database from the value you get by plugging in
"now" into the mktime function.  If that value is greater than 3600 (60
minutes/hour * 60 seconds/minute) then it's been more than one hour.



More information about the thelist mailing list