Home Consulting Training Blog FREE Tips & Tools Login

How to adjust dates in Pipelines using Jinja in Pipelines

Subscribe on YouTube

>> Get the Jinja Date & Time Cheat Sheet <<

Relative dates are used all the time, so why not use them in Pipelines!

For example, add a task to a project that has a due date of 2 days from the project start date.

Or set a next payment due date for the first of the month following receipt of this month's payment.

Or maybe you just need to set the end time for a meeting 1 hour after the start.

By adding Jinja to your Pipeline, you can take an initial date or date/time value and derive a new 'adjusted' time value.

With 2 Jinja functions, it's possible to...

  • Add or subtract days, months, or years from today
  • Add or subtract days, months, or years from another date
  • Add or subtract hours, minutes, or seconds from any date/time
  • Replace one or more values in a date with a specific month, day, or year
  • Replace one or more values in a time with a specific hour, minute or second

The Jinja Functions

time.delta()

Used to offset a date/time value by a specified amount of time, such as hours, days, or months.

.replace()

Replaces the day, month, or year in a date value or hour, minute, and second in a date/time value.

A Few Examples

Add 3 hours to the Current Time

{{ time.now + time.delta(hours=3) }}

With an adjustment for timezone:
{{ (time.now|timezone('America/New_York')) + time.delta(hours=3) }}

Add 3 days to a Start Date field from step A in the Pipeline

{{ a.start_date + time.delta(days=3) }}

Adjusting for both days and months:
{{ a.start_date + time.delta(months=2,days=3) }}

Add 1 month to a Due Date field and set the date to the 1st

{{ a.due_date.replace(day=1) + time.delta(months=1) }}

Be sure to watch the video for more examples and tips.

These date/time adjustments are sure to come in handy!

Don't forget, there are 6 different areas where Jinja and these adjusted dates/times can be used in Pipelines (covered in the Jinja Date & Time Cheat Sheet).

 

Did you know Quick Base Junkie has online training programs?
Topics include Relationships, Formulas, HTML, Jinja, APIs, and MORE! 

 

For more information on Jinja see the resources below, or skip right to the good stuff and get the Intro to Jinja for Pipelines course today!

 

RESOURCES:

Get the FREE Jinja Date & Time Cheat Sheet mentioned in this video

Learn more about how Jinja works in Pipelines

Set the time zone using Jinja

 

Feeling like a Junkie?  Subscribe Now!

Don't miss the latest:

Tips, shortcuts, checklists, reviews, tutorials, and courses from Quick Base Junkie!

Subscribe now to stay in touch

Don't worry, your information will not be shared.

Subscribe

Already subscribed?

Take your Quick Base skills to the next level with Premium Courses.

Explore Courses Now
Close

Don't miss the latest:

Tips, shortcuts, reviews, tutorials, and courses from Quick Base Junkie!

Sign up now to stay in touch

(unsubscribe anytime)