Articles on: Frequently Asked Questions (FAQ)

How to add dynamic date format in metafield?

{{ data[2] | add_day_to_date: “%d.%m.%y %H:%M”, data[1] }}


Date and Time strftime Format Options


Format

Description

Example

%b

Shortened month name

"Jan"

%B

Full month name

"January"

%m

Numbered month of the year (01..12)

"01"

%d

Day of the month (01..31)

"15"

%j

Day of the year (001..366)

"123"

%a

Shortened weekday name

"Mon"

%A

Full weekday name

"Monday"

%w

The numeric day of the week (0..6)

"1"

%U

Numeric week number in the year (0..53) [starting with the first Sunday]

"22"

%W

Numeric week number in the year (0..53) [starting with the first Monday]

"22"

%y

Two-digit year (00..99)

"99"

%Y

Four-digit year

"2022"

%H

Hour of the day (military time) (00..23)

"18"

%I

Hour of the day (12-hour clock) (01..12)

"08"

%M

Minute of the hour (0..59)

"15"

%S

Second of the minute (0..59)

"30"

%p

AM or PM

"PM"

%Z

Time zone name

"Central Time (US & Canada)"


Updated on: 15/04/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!