The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Calendar dateline_to wrong date
I'm trying to pull the events from the calendar and display them on a custom PHP page. Here is my query:
SELECT eventid,event,dateline_from,dateline_to,title,dst FROM vb_event WHERE dateline_from >= ".$iTimeStamp." AND dateline_from <= ".($iTimeStamp+$addTime)." ORDER BY dateline_from ASC Where iTimeStamp is today's date and iTimeStamp+addTime is so time in the future (30, 60 days, etc). The date is coming out one day off on SOME events but not all. Even when checking the unix timestamp using a converter - the timestamp is wrong. How do I compensate for this or can someone please shed some light on how VBulletin stores these dates? |
#2
|
||||
|
||||
All timestamps are in Unix Time - there is nothing really "special" about them.
|
#3
|
|||
|
|||
After a fresh nights sleep I was able to track down my problem. I wasn't compensating for the GMT offset properly. We're GMT-5. So for an event that was scheduled for 7:30pm on 5/10 would display as 5/11. Added in the correct offset, -18000 (3600*utc field in the DB), and everything works like a champ.
|
#4
|
||||
|
||||
Make sure you store the timestamp in UTC, and don't add timezone differences. Only compensate when displaying.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|