# Logstash - %{+YYYY} returns a year two years behind around year boundary – how is this possible?

**URL:** <https://discuss.elastic.co/t/logstash-yyyy-returns-a-year-two-years-behind-around-year-boundary-how-is-this-possible/384359>\
**Category:** Logstash\
**Tags:** runtime\
**Created:** [January 5, 2026, 9:48am UTC](https://discuss.elastic.co/t/logstash-yyyy-returns-a-year-two-years-behind-around-year-boundary-how-is-this-possible/384359 "2026-01-05T09:48:21Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [January 6, 2026, 3:19am UTC](https://discuss.elastic.co/t/logstash-yyyy-returns-a-year-two-years-behind-around-year-boundary-how-is-this-possible/384359/6 "2026-01-06T03:19:23Z")

</div>

> [@josh\_tran](#):
>
> Is `%{+YYYY}` in Logstash always derived from `@timestamp` at the time the mutate filter runs?

Yes, always. But logstash just [calls Joda](https://github.com/elastic/logstash/blob/f9d8b771e565bfe35fc71e72ae389eaa3df26d03/logstash-core/src/main/java/org/logstash/StringInterpolation.java#L103) to do the parsing. I don’t know if it is documented, but that looks like you could also try a Java (`%{{yyyy}}`) format to get a different parser.

**If** you were using a date filter to set the timestamp (and I hear that you say that are not) then there would be other possible issues around [heuristics](https://discuss.elastic.co/t/add-date-and-seconds-to-odd-iso-8601-ish-timestamp/288031/2) used to [guess](https://github.com/logstash-plugins/logstash-filter-date/blob/d0ed7e3f2fd05ca6e4d32b5d4d89ddf1b6dcb2cb/src/main/java/org/logstash/filters/parser/JodaParser.java#L97) years from timestamps that do not include the year.

---

_[View the full topic](https://discuss.elastic.co/t/logstash-yyyy-returns-a-year-two-years-behind-around-year-boundary-how-is-this-possible/384359)._
