Codeigniter: Compare a MySql Datetime with Current Date

nutz

New Member
I need to compare a MySQL datetime with the current time, to get the dateDiff to show a messange if the MySQL datetime, is less than 30 days from today.I'm using codeigniter, and I tried a lot of helpers, and lots of thing, I just can't get to work.Some people says that is better to save in database a timespan, I just don't know wich one is the best aproach.Thanks in advance!EDIT: I'm looking for a CI code, or a Mysql Code, or both, to get it to work. It doesn't matter where i get the current date (could be mysql or server time).Also, I have the needed code on the view, and the controller, I just need some model code to get it, or MySql code
 
Back
Top