Title: [Bug] in &#8220;year with offset&#8221; shortcode
Last modified: February 18, 2026

---

# [Bug] in “year with offset” shortcode

 *  Resolved [André](https://wordpress.org/support/users/andrechaperon/)
 * (@andrechaperon)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/bug-in-year-with-offset-shortcode/)
 * Hi Gaurav — really nice plugin!
 * I think I’ve found a small edge-case bug/formatting issue with the [year] shortcode
   when n is a large negative number (somewhere in the 4 digits).
 * This works as expected:
 * `[age date="2003-01-01"]`
 * Expected output: 23 (and that’s what I get)
 * But this doesn’t behave as expected:
 * `[year n=-2003]`
 * I’d expect this to output the current year minus 2003 (e.g., 23 in 2026), but
   it seems like 2003 is “too large” and something breaks once n crosses into 4 
   digits somewhere.
 * Also, this looks like a zero-padding issue:
 * `[year n=-1100]`
 * Current output: 0926
   Expected output: 926
 * Not a big deal on my end since `[age date="2003-01-01"]` works for my use case—
   just wanted to flag it in case you’d like to harden the `[year]` path (or strip
   leading zeros).
 * André
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fbug-in-year-with-offset-shortcode%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Gaurav Tiwari](https://wordpress.org/support/users/gauravtiwari/)
 * (@gauravtiwari)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/bug-in-year-with-offset-shortcode/#post-18825617)
 * Hi André, I’ll be honest – I didn’t try it with such large offsets. I am working
   on an update and add these improvements to the update. For the time being, I 
   am marking this as resolved, but I will let you know once the update is released.
 *  Thread Starter [André](https://wordpress.org/support/users/andrechaperon/)
 * (@andrechaperon)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/bug-in-year-with-offset-shortcode/#post-18825652)
 * 👍
 *  Plugin Author [Gaurav Tiwari](https://wordpress.org/support/users/gauravtiwari/)
 * (@gauravtiwari)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/bug-in-year-with-offset-shortcode/#post-18825703)
 * Just pushed the update [@andrechaperon](https://wordpress.org/support/users/andrechaperon/).
   Please test it and let me know if something bothers you again. 🙂
 *  Thread Starter [André](https://wordpress.org/support/users/andrechaperon/)
 * (@andrechaperon)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/bug-in-year-with-offset-shortcode/#post-18825709)
 * Boom! Nice one, Gaurav. It’s working as expect now.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fbug-in-year-with-offset-shortcode%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/dynamic-month-year-into-posts/assets/icon-256x256.png?rev
   =3468394)
 * [Dynamic Month & Year into Posts](https://wordpress.org/plugins/dynamic-month-year-into-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/dynamic-month-year-into-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/dynamic-month-year-into-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/dynamic-month-year-into-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dynamic-month-year-into-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dynamic-month-year-into-posts/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [André](https://wordpress.org/support/users/andrechaperon/)
 * Last activity: [3 months, 3 weeks ago](https://wordpress.org/support/topic/bug-in-year-with-offset-shortcode/#post-18825709)
 * Status: resolved