Dear All, I want to use a fixed point in time in ...
# ask-community
b
Dear All, I want to use a fixed point in time in my tasks. An option would be to create a task whiche returns current datetime, but i suppose that flow can offer this information in form of a flow start time. Is a way to get a flow stard date time in a task? Thanks for your answers!
1
l
Would
prefect.context.get("scheduled_start_time")
give you the information you need ?
b
Yes this should be it. But as i understand it is UTC time, is it posible to get it in local time or do i have to convert it?
d
Hi @Borut Hafner! I definitely second Loic’s suggestion here. Yes, you will need to convert the timestamp yourself, but that should be a straightforward exercise in python. I personally love https://pendulum.eustace.io/
b
Thanks both! I agree about conversion, but I asked just in case, if prefect provides this functionality.