Welcome to WebmasterWorld Guest from 184.108.40.206 , register , free tools , login , search , subscribe , help , library , announcements , recent posts , open posts Pubcon Website
Unix Timestamps in PHP *help* lorax msg:1288850 7:42 pm on Sep 11, 2002 (gmt 0) I've written a script to count the number of days between an event and today. It's my understanding the best way to work with date comparisons is to convert everything to Unix Timestamp and then do the calcs. The problem is that I can't seem to get the conversion to work. The code for the conversion from to Unix Timestamp is:
$then_ux = mktime("","","",date("n,d,Y",strtotime($followup["fdate"])));
This seems more complicated than it needs to be.
The conversion from Unix to text is getdate($then_ux) -- to verify the first conversion -- gives me a date that's 8 days earlier.
fdate comes from a MySQL DATE field. I've thought of using Date_Format() in the query but can't use it because I need to keep the date the way it is for other reasons.
Any thoughts would be appreciated!
lorax msg:1288851 8:20 pm on Sep 11, 2002 (gmt 0)
Thanks for checking but I figured it out.