Squishdot Post Time-Shifting Code - For Posterity
This is for posterity. I hope someone can use it in the future and save themselves a little time. The Problem: Your Zope site (and, but extension your Squishdot site) are in a server in one time zone, and your users are in another time zone. Your users are annoyed when their postings seem to be seven hours off. While you are happy that they notice such things, they pepper you with emails and postings to the effect that something is wrong, when in fact, all is right. To stop receiving the "bug" notices, you need some code to "time shift" the time displayed by Squishdot from your user's time zone. The Solution: In the index_html and posting_html DTML Methods in the Squishdot site, replace... <dtml-var date_posted> with... <dtml-let my_zone=date> <dtml-var "my_zone-0.2916667" fmt="%A %B %d, %Y at %I:%M %p"> </dtml-let> .. where, in the case above, 0.2916667 is the time shift (7/24) to move from the Netherlands to CST. Substitute the value above for your time shift. The posting object has a "date" method that retuns a DateTime that you can use to perform the arithmatic. Many thanks to Chris Withers for his astounding patience. Hope that helps. Ron
complaw@hal-pc.org wrote:
The posting object has a "date" method that retuns a DateTime that you can use to perform the arithmatic. Many thanks to Chris Withers for his astounding patience.
*grinz* Now that I want recorded for posterity, I think it's the first time anyone has ever seen me have patience rather than cause patients ;-) Chris
participants (2)
-
Chris Withers -
complaw@hal-pc.org