sintax63 Posted May 21, 2008 Share Posted May 21, 2008 OK, so perhaps "early" isn't as correct as that the event gets removed from my calendar at 12:01 am the day it happens. Is there any way to alter my code to do a "expire the day after" or better yet, expire the time the event happens on said day? $query="SELECT *, DATE_FORMAT( `date`, '%m/%d' ) AS displayDate FROM calendar WHERE status='1' AND `date` >= NOW() ORDER BY date ASC LIMIT 5"; Any help would be greatly appreciated! Link to comment https://forums.phpfreaks.com/topic/106671-event-calendar-event-expires-early/ Share on other sites More sharing options...
dare87 Posted May 21, 2008 Share Posted May 21, 2008 I had the same problem a while ago.. I had to use CURDATE() in place of NOW() and I had to have my db set as DATETIME with 23:59:59 as the time. Don't know if that will help... Link to comment https://forums.phpfreaks.com/topic/106671-event-calendar-event-expires-early/#findComment-546793 Share on other sites More sharing options...
sintax63 Posted May 21, 2008 Author Share Posted May 21, 2008 I'm using date (0000-00-00) and time (00:00:00) in two separate fields. I'm guessing that I would need to redo my databases to use the datetime solution you posted? :-\ Link to comment https://forums.phpfreaks.com/topic/106671-event-calendar-event-expires-early/#findComment-546804 Share on other sites More sharing options...
revraz Posted May 21, 2008 Share Posted May 21, 2008 If you use both time and date, then you should use a datetime field to make it easy on yourself. I use Unix Timestamps myself. I'm using date (0000-00-00) and time (00:00:00) in two separate fields. I'm guessing that I would need to redo my databases to use the datetime solution you posted? :-\ Link to comment https://forums.phpfreaks.com/topic/106671-event-calendar-event-expires-early/#findComment-546810 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.