在常规的 python 代码中我可以这样做:
import time
int(time.time())
Run Code Online (Sandbox Code Playgroud)
这给了我纪元般的时间。我希望能够使用气流宏来做到这一点:execution_date
这是我尝试过的:
"{{ strptime(execution_date.strftime('%Y-%m-%d %H:%M:%S'), '%d.%m.%Y %H:%M:%S') }}"
Run Code Online (Sandbox Code Playgroud)
但这给出了:
jinja2.exceptions.UndefinedError:“strptime”未定义
我正在运行 Airflow 1.9 和 Python 2.7