• KodeRian
    KodeRian — A place to share tips, tricks, SEO insights, coding guides, and Blogger tutorials covering HTML, CSS, JavaScript, and AdSense.

    Understanding and Using the Operator Date in Blogger

    Learn how to use the Blogger Operator Date with ICU formatting to style dates precisely in your blog templates

    Ever felt annoyed that Blogger shows dates in a fixed layout—“June 5, 2025” or something similar—and you wish you could tweak how the date appears (weekday first, local language, custom separators)? That’s where the Operator Date in Blogger comes in. In this article I’ll walk you through how to use this operator (with ICU formatting support) so your blog’s date displays exactly as you intend.

    Understanding and Using the Operator Date in Blogger

    Introduction: Why Date Formatting Matters in Blogger

    By default, Blogger uses a generic date format that may not match your site’s style or locale. But with the Operator Date and ICU (International Components for Unicode) pattern syntax, you can customize how year, month, day, weekday, and even time appear—tailoring them to your language, region, or design aesthetic. This is particularly helpful when using Blogger version layouts (Layout 3 or Gadget 2) and in widgets like FeaturedPost, PopularPost, or RecentPosts, where date formatting impacts readability and professionalism.

    In this guide you’ll find:

    • A clear syntax reference for the Operator Date
    • A deeper look at ICU symbols (year, month, day, etc.)
    • A step-by-step tutorial to implement your own date format in Blogger templates or widgets
    • Extra tips, FAQs, and troubleshooting notes

    Understanding the Operator Date Syntax

    The Operator Date in Blogger allows two main syntactic styles:

    • Default operator syntax: {date} format {string}
    • Functional syntax: format({date}, {string})

    The functional syntax is especially recommended when you have multiple date operators in the same expression or when you want clarity and consistency. It avoids ambiguity if you repeat “format” or have nested operators.

    Here’s a summarizing table:

    Name Operator Operand Default Syntax Functional Syntax Result
    Format format 2 {date} format {string} format({date},{string}) date (formatted)

    In short: you feed it a date object, plus a formatting string (pattern), and it outputs your customized date string.

    ICU Date-Time Patterns: The Heart of Formatting

    ICU (International Components for Unicode) is a widely adopted standard for date/time formatting across many platforms. It lets you pick symbols (like “YYYY”, “MMM”, “dd”) to represent year, month, day, weekday, hour, minute, etc., and combine them into a pattern string. Blogger supports many of these symbols in its templates, so you can craft flexible date formats.

    Below is a reference table of common symbols supported by Blogger (you can find a more complete list at Unicode’s official site):

    PeriodSymbolExample OutputDescription
    YearYY172-digit year
    YYYY20174-digit full year
    MonthM1, 11Month, minimum 1 digit
    MM01, 11Month, 2 digits
    MMMJan, NovAbbreviated month name
    MMMMJanuary, NovemberFull month name
    MMMMMJ, NFirst letter of month
    Weekw1, 11Week of year, minimum 1 digit
    ww01, 11Week of year, 2 digits
    W4Week within month
    Day / Weekdayd1, 11Day of month (min 1 digit)
    dd01, 11Day of month, 2 digits
    D1, 55,362Day of year (min 1 digit)
    DD01, 55,362Day of year, min 2 digits
    DDD001, 055,362Day of year, min 3 digits
    F3Xth day of the month (e.g. 3rd Tuesday)
    EL, MWeekday name, 1 letter
    EELu, MaWeekday name, 2 letters
    EEEMon, TueAbbreviated weekday name
    EEEEMonday, TuesdayFull weekday name
    Period (AM/PM, etc.)aaaaAM, PMTypically locale-sensitive afternoon/morning names
    bbbbMatin, Après-midiLocale-based period name
    BBBB(varies)Alternate period name
    Hour / Minuteh1, 11Hour in 1–12, min 1 digit
    hh01, 11Hour in 1–12, 2 digits
    H0, 21Hour in 0–23, min 1 digit
    HH00–23 two digitsHour in 24h two digits
    m1, 59Minute, min 1 digit
    mm01, 59Minute, exactly 2 digits

    Step-by-Step: How to Use Operator Date in Blogger Templates or Widgets

    Here’s how you can insert or change date formats using Operator Date in your blog template or widgets (FeaturedPost, PopularPost, etc.). Follow these steps carefully.

    Step 1: Open your Blogger template or widget code

    In the Blogger dashboard, go to Theme → Edit HTML (or in the widget section, find the widget where you want the date to appear). Always back up your template before editing.

    Step 2: Locate the date expression

    Search within the HTML for something like:

    <time class='published' expr:datetime='data:post.date.iso8601' expr:title='data:post.date.iso8601'>
        <b:eval expr='data:post.date' />
      </time>

    This is where the raw date is being output. We want to wrap or replace that with our formatted expression.

    Step 3: Use the format operator

    Replace the basic expression with one that uses the Operator Date, for example:

    <time class='published' expr:datetime='data:post.date.iso8601'
           expr:title='data:post.date.iso8601'>
        <b:eval expr='format(data:post.date, "EEEE, d MMM YYYY")'/>
      </time>
      <meta expr:content='data:post.date.iso8601' itemprop='datePublished'/>

    In this example, the pattern "EEEE, d MMM YYYY" yields something like “Tuesday, 5 Oct 2025” (depending on your locale). You can adjust the pattern to your liking, mixing weekday, day, month (short or full), year, etc.

    Step 4: Save and preview

    Once you’ve added or replaced the expression, save the template (or widget). Then view your blog or post page to see whether the date displays in the format you intended. If something is off, go back and tweak the pattern string.

    Step 5: Experiment and iterate

    Try alternative patterns to suit your locale or style. For instance:

    • "dd/MM/YYYY" → “05/10/2025”
    • "EEEE, dd MMMM YYYY" → “Tuesday, 05 October 2025”
    • "EEE, MMM d, YYYY h:mm aaaa" → “Tue, Oct 5, 2025 3:45 PM”

    Extra Tips & Best Practices

    • Use the functional syntax when in doubt: format(data:post.date, "pattern") is clearer than multiple operator chains.
    • Be consistent: Use the same pattern across your site so readers won’t get confused by different date styles.
    • Locale matters: Some months or weekdays may appear in English by default; if your locale is non-English, check whether Blogger respects your blog’s language setting (or enforce custom names manually).
    • Time zone awareness: ICU supports time zones, so if your blog audience is geographically specific, this helps keep dates accurate per locale.
    • Fallback formatting: In parts of the template that don’t accept format(), you may have to stick with default date output—but you can often wrap or nest output expressions.
    • Backup always: Before editing templates, make a copy. A small mistake can break template parsing.

    FAQ (Frequently Asked Questions)

    Q: Can I use this in older Blogger layouts?

    A: The Operator Date is best supported in Layout 3 and Gadget 2 versions. Older versions may support it partially, but behavior is less predictable.

    Q: What if my month or day names appear in English but I want Bahasa?

    A: This depends on your blog’s language settings and whether Blogger localizes ICU output. If it doesn’t, you may need to write a manual mapping (for example, replace “January” with “Januari”) via conditional logic or JavaScript.

    Q: Why did my template break after I saved?

    A: Often it's due to mismatched quotes, missing escape characters, or tags not closed properly. Double-check your quotes around the pattern string and ensure the or tags are closed correctly.

    Q: Can I include time (hours, minutes) in the format?

    A: Yes. Using symbols like H, HH, h, hh, m, mm, and period markers like aaaa (for AM/PM) lets you display time along with date.

    Troubleshooting Common Issues

    • No change after editing: Clear the cache or view the live site; sometimes preview doesn’t reflect changes immediately.
    • Invalid pattern errors: If your pattern string contains unrecognized symbols, Blogger may reject the entire expression. Stick to ICU-supported symbols.
    • Locale mismatch: If your blog is in Indonesian but weekday names show in English, test on a published post—not in preview—and check your blog’s language setting under Settings → Language.
    • Widget doesn’t accept format(): In some widget contexts, nested evaluations are restricted. Try simplifying the expression or placing the formatting in a parent template instead.

    Conclusion

    The Operator Date in Blogger gives you control. You’re no longer stuck with Blogger’s default date style—you can tailor the look and feel to match your brand, your language, and your audience. With ICU’s pattern flexibility and the functional syntax, you can build formats like “Tuesday, 5 October 2025 14:30” or “05-10-25” or anything in between. Try it out, iterate a few patterns, and see what feels cleanest across your site.

    If you found this useful, don’t forget to bookmark this post, share it with other bloggers, and subscribe to get updates whenever I publish new template tips!

    Post a Comment

    Comment Guidelines

    Please keep your comments relevant to the topic (Blogger, SEO, coding, etc.).

    Be respectful — no spam, offensive language, or personal attacks.

    You may share suggestions, bug reports, or tutorial requests.

    External links are allowed only if they are truly helpful and not for promotion.

    Feedback will be reviewed, and I will try to reply as soon as possible.

    By commenting here, you help improve KodeRian and keep the discussion useful for everyone.