tz

Python - Can't subtract offset-naive and offset-aware datetimes

I have a timezone aware timestamptz field in PostgreSQL. When I pull data from the table, I then want to subtract the time right now so I can get it's age. The problem I'm having is that both datetime.datetime.now() and datetime.datetime.utcnow() seem to return timezone unaware timestamps, which results in me getting this error: TypeEr...

TZ Var to Java TimeZone?

I need to convert from the Unix TZ variable of the form: stdoffset[dst[offset][,start[/time],end[/time]]] into a Java TimeZone object. For example, convert AEST-10AEDT-11,M10.1.0/02:00:00,M4.1.0/03:00:00 into a Java TimeZone object that represents "Australia\Sydney". Before I go and write the code myself I'd like to know I'm not inventi...

python-tz am I wrong or it's a bug

Hi Guy, It's a bit weird it seems that when I want to get a timezone for Europe/Paris with pytz it gets me to the PMT timezone instead of GMT+1 when it seems to work for Europe/Berlin. Not clear ? Well look at this snippet : #!/usr/bin/python import os import datetime from pytz.tzfile import build_tzinfo base='/usr/share/zoneinfo/' t...

How can I get and use a user's TZ setting from their .bashrc in a Perl CGI script?

Each of my users has a (possibly) different TZ defined in their .bashrc. I have a Perl script that displays date/time and want it to have it display with their profile time zone. Does anyone know the best way to do this? ...