Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8562713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:47:24+00:00 2026-06-11T16:47:24+00:00

I’ve got a Plone instance that’s being run for users in Sydney, so the

  • 0

I’ve got a Plone instance that’s being run for users in Sydney, so the TZ environment variable is set to Australia/Sydney. With this set, code that uses the DateTime module from Zope2 produces results that display the wrong timezone. For instance:

>>> import time
>>> import DateTime
>>> print time.strftime("%a, %d %b %Y %T %z") # 
Thu, 20 Sep 2012 02:38:08 +1000
>>> print DateTime.DateTime().rfc822()
Thu, 20 Sep 2012 02:38:08 -0400

This is rather problematic because Products.MailHost sets the Date: header on outgoing emails to the value DateTime().rfc822() (on line 466 of MailHost.py). Because the offset is wrong, the time in the Date header is now 12 hours into the future. SMTP servers receiving that email will often summarily reject it!

Other code in the same instance is quite happily behaving correctly with that TZ variable because it uses the datetime module in Python, which is all based on libc’s time.h functions.

So, what do people do in order to get the Plone’s MailHost to work in Australian time zones?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:47:25+00:00Added an answer on June 11, 2026 at 4:47 pm

    Unfortunately, TZ=Australia/Sydney becomes time.tzname == ('EST', 'EST'):

    $ TZ=Australia/Sydney bin/zopepy -c "import time; print time.tzname"
    ('EST', 'EST')
    

    And the DateTime internal database translates that to US/Eastern. It is an unfortunate side-effect of Eastern Standard Time being the name for more than one timezone.

    You’d need to specify a more explicit TZ variable specifying the offsets and the DST switch dates, with a new timezone name that won’t be misinterpreted:

    TZ="AEST-10AEDT-11,M10.1.0/02:00:00,M4.1.0/03:00:00"
    

    The above value comes from the still open bug report and happens to be perfect for your purposes:

    $ TZ="AEST-10AEDT-11,M10.1.0/02:00:00,M4.1.0/03:00:00" bin/zopepy
    >>> import DateTime
    >>> import sys
    >>> m = sys.modules['DateTime.DateTime']
    >>> m._findLocalTimeZoneName(0)
    'GMT+10'
    >>> m._findLocalTimeZoneName(1)
    'GMT+11'
    >>> import DateTime
    >>> DateTime.DateTime()
    DateTime('2012/09/21 00:12:0.765691 GMT+10')
    >>> DateTime.DateTime().rfc822()
    'Fri, 21 Sep 2012 00:12:04 +1000'
    

    You can add the TZ environment variable to your Zope configuration by sepecifying it in the buildout:

    [instance]
    recipe = plone.recipe.zope2instance
    ...
    environment-vars =
        TZ AEST-10AEDT-11,M10.1.0/02:00:00,M4.1.0/03:00:00
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I know there's a lot of other questions out there that deal with this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.