You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "George Leslie-Waksman (JIRA)" <ji...@apache.org> on 2017/12/22 03:50:02 UTC

[jira] [Commented] (AIRFLOW-1930) start_date and execution_date should default to timezone.utcnow() not to func.now()

    [ https://issues.apache.org/jira/browse/AIRFLOW-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300932#comment-16300932 ] 

George Leslie-Waksman commented on AIRFLOW-1930:
------------------------------------------------

If your columns are timezone aware it doesn't matter what timezone the server uses. That is why we are using timezone aware columns.

Changing this potentially causes exactly the problem you are trying to avoid: suppose I am in -7:00 timezone and my server is set to UTC; now I create a new timezone aware datetime at 15:00-7:00 but I calculate now using utcnow, what ends up being created is 24:00-7:00, which gets stored as 7:00UTC the next day.

If columns are timezone aware, feed them timezone aware, then the columns and datetime objects will take care of all of this for you.

This is NOT a bug; this is working as intended.

> start_date and execution_date should default to timezone.utcnow() not to func.now()
> -----------------------------------------------------------------------------------
>
>                 Key: AIRFLOW-1930
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1930
>             Project: Apache Airflow
>          Issue Type: Bug
>    Affects Versions: 1.9.0, 1.8.2
>            Reporter: Bolke de Bruin
>            Assignee: Bolke de Bruin
>             Fix For: 1.9.1
>
>
> func.now() defaults to the time zone of the database, while we assume every date in the db is UTC. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)