replacing datetime.strftime('%s'), as it's not platform independent (and not documented...), better timezone handling