Modify ↓
      
Opened 16 years ago
Closed 16 years ago
#8738 closed enhancement (fixed)
LocalTimezone should have a meaningful str implementation
| Reported by: | Owned by: | Remy Blank | |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.12 | 
| Component: | general | Version: | 0.12dev | 
| Severity: | minor | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
Currently the LocalTimezone implementation only returns the default Python object id. I would like to have a more readable 'str()' output which also shows the UTC offset.
Attachments (1)
Change History (3)
by , 16 years ago
| Attachment: | 8738_nice_output_for_localtz.patch added | 
|---|
comment:2 by , 16 years ago
| Resolution: | → fixed | 
|---|---|
| Status: | new → closed | 
__str__() and __repr__() were added to LocalTimezone in [8742]. The former returns the name of the timezone (using tzname() as suggested), and the latter contains both timezone names and their offsets from UTC.
  Note:
 See   TracTickets
 for help on using tickets.
    


  
This patch is a simple implementation which is not always correct (in timezones with day light saving) - we could also use tzname().