Skip to main content
Solved

Automatically change year in new attribute

  • April 9, 2025
  • 1 reply
  • 39 views

vxn43
Supporter
Forum|alt.badge.img+18

I have a new attribute named EXPORT_YEAR. I want the Attribute Value to automatically change to 2026 at 12:00AM Jan 1, 2026. Until then it will stay 2025. Is this possible? if yes, what expression do I use?

 

 

 

Best answer by takashi

If you need to get the current year when the workspace is run, DateTimeStamper might help you.
Or, you can also use this expression to retrieve the current year.

 @Left(@DateTimeNow(),4)

 

See here to learn more about FME Date/Time functions.

https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Form/!Transformer_Parameters/Date-Time-Functions.htm

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

takashi
Celebrity
  • Best Answer
  • April 9, 2025

If you need to get the current year when the workspace is run, DateTimeStamper might help you.
Or, you can also use this expression to retrieve the current year.

 @Left(@DateTimeNow(),4)

 

See here to learn more about FME Date/Time functions.

https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Form/!Transformer_Parameters/Date-Time-Functions.htm