View Single Post

  #4 (permalink)  
Old 08-12-2006, 10:41 AM
louie's Avatar
louie louie is offline
Senior Member
 
Join Date: Jan 2006
Location: Dublin, Ireland
Posts: 2,048
Nominated 5 Times in 3 Posts
Nominated TOTW/F/M Award(s): 1
louie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enough
Send a message via Yahoo to louie Send a message via Skype™ to louie
Default

It's more complicated to explain but I'll give it a try.
The date in the database is stored as Y-m-d H:i:s
on getting the data I was converting the date/time to IRL format (UK), then try to compare it against now() (also formated for UK).
Using echo or print they both looked fine and it would work OK if the end date wasn't 2007 (as year) and > 20 (as day). weird alright.

After more thinking and couldn't find a proper solution I resumed at not formatting the date/time, just leave it as it was (US format).
Based on that used strtotime (used in the above example as well) function to convert it to timestamp and compare then. It works, but I still can not understand why the other way around wouldn't.

I'll be honest working with date/time it's a lot easier in ASP than PHP.
__________________
:. Web Design & Development Web Design Ireland
:. Search Engines Optimization Search Engines Optimization
:. Directory Submission Directory Submission
:. News & Press Release Ireland GiveItSocks.com
:. Used Cars Ireland, Car Parts & Car Audio Cars For Sale, Car Parts & Accessories
:. I Have 2 Find It Directory SEF Directory
Reply With Quote