Forum Discussion
PrashantMaheshw
9 months agoQrew Captain
QuickBase supports jinja filters in pipeline
https://helpv2.quickbase.com/hc/en-us/articles/4471048652308-Using-Jinja-in-Quickbase-Pipelines
stringptime is not supported
chatGPT is notorious for including python function. I highly recommend taking the jinja course from QuickBase Junkie which has detailed bible.
The easiest way to do this is going to be a formula , you can use a combination of parts to extract AM PM , then another part to get hour and minute function to convert to military time and then simply copy that .
If you are bent on jinja to achieve this , this is something which was cooked chatGPT (again thanks to QuickBase Junkie bible- I could correct chatgpt), I tested this with 4:30 PM and 11:30 PM.
{% set time_str = "11:30 PM" %}
{% set split_ampm = time_str.split(' ') %}
{% set split_time = split_ampm[0].split(':') %}
{% set hour_val = split_time[0] %}
{% set minute_val = split_time[1]|default(0) %}
{% set am_pm = split_ampm[1] %}
{% set military_hour = hour_val|int %}
{% if "PM" in am_pm %}
{% if military_hour != 12 %}
{% set military_hour = military_hour + 12 %}
{% endif %}
{% endif %}
{% set military_time_str = "%02d:%02d" % (military_hour, minute_val|int) %}
{{ military_time_str }}