Discussions

 View Only

(Answer) Auto Time Adjusting Jinja Date

  • 1.  (Answer) Auto Time Adjusting Jinja Date

    Posted 11-28-2022 16:20
    This took me some time to achieve 

    You can use Time.delta in Jinja to adjust hours ,weeks , months or even years. 

    I had a case to create an auto reminder after 3 months after the date was created (ofcourse we could use a simple formula field but where's the fun)

    {{((time.now|timezone('Asia/Calcutta'))+ time.delta(months=3)).strftime('%Y-%m-%d')}}

    • Replace TimeZone with your time zone


    ------------------------------
    Prashant Maheshwari
    ------------------------------