Getting yesterdays date with time zone
Question: Hi I was able to find the answer to this question but now with the timezone
included (http://stackoverflow.com/questions/1712116/formatting-yesterdays-
date-in-python)

This is working fine for me:

    
    
    >>> import time
    >>> time.strftime('/%Z/%Y/%m/%d')
    '/EST/2013/01/18'
    

but is there a way to get the yesterdays date? I need to handle the timezone
change when we switch from EST to EDT, EDT to EST

datetime modules allows to use timedelta, but the naive object don't support
timezones by default and I'm not sure how to handle that.


Answer: the do it yourself method, but i don't know if there is a better method

    
    
    >>> import time
    >>> from datetime import date, timedelta
    >>> yesterday = date.today() - timedelta(1)
    >>> yesterday = yesterday.strftime('%Y/%m/%d')
    >>> yesterday = "/%s/%s" % ( time.tzname[0], yesterday )
    >>> print yesterday
    '/CET/2013/01/17'
    

