Compare dates

17 posts by 4 authors in: Forums > CMS Builder
Last Post: January 27, 2010   (RSS)

By gkornbluth - January 12, 2010

I tend to agree, but yes, events which occur on the current day are showing up in your bottom list. (I just checked again)

Do you think it could it have something to do with the way I'm formatting the dates when I define

$eventDateString = date("l, F jS", $eventUnixTime);

and

$currentDateString = date("l, F jS", $currentUnixTime);

?

Thanks,

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By gkornbluth - January 14, 2010

Chris,

Thanks for this.

I'm not ignoring you but I need to finish some stuff before I can get back to it.

I'll let you know what I find.

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Compare dates

By Chris - January 14, 2010

Hi Jerry,

No worries. Take your time. I'm subscribed to the thread, so I'll see when you respond, whether it's in 2 days or 2 months. :)
All the best,
Chris

By gkornbluth - January 26, 2010 - edited: January 26, 2010

Hi Chris,

Well I finally was able to return to this issue, and indications point the fact that both the test for “isFutureEvent” and the test for “isEventOver” excluded a match for “isEventToday”.

I got around this by creating another test for “isEventToday” and display that group at the top of the “meetings” viewer as “Today’s Events”.

I also noticed that my “server” time is 5 hours later than my “local” time.

When I inserted the test code, added an extended currentUnixTime showing hours, minutes and seconds and tested the page, everything worked as expected, the test results made sense, and items were displayed in the correct areas on the page. Unless I'm wrong, it appears that the currentUnixTime is dependent on local time not server time.

This also seems to be related to the issue presented in Show_date/time_and_time_zones._P77048

Best,

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Compare dates

By Dave - January 27, 2010

Hi Jerry,

Is your timezone set correctly under: Admin > General > Regional Settings?

Date math is notoriously difficult, for this and many other reasons.

If this is still an issue, and the timezone is set correctly then we'll have to go line by line and figure out which line is giving us the wrong date.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Compare dates

By gkornbluth - January 27, 2010

Hi Dave,

As I mentioned in my last post, everything seems to be working as expected.

Thank you all for your help.

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php