Skip to main content
Solved

How to calculate the last day of previous month in FME?

  • February 21, 2023
  • 2 replies
  • 359 views

Hi guys, I am fairly new in FME but have been working in a workflow and got stuck on something that might be simple solution for some of you. I need to be able of calculating the last calendar day of previous month from today's date.

 

So today being 21/02/2023 my result should be 31/01/2023.

 

Can you please advise how I can do this ? I have been really struggling to do this and have attempted DateTime Calculator transformer.

Best answer by ebygomm

Assuming your date is in an FME format, i.e. 20230221, take the first 6 digits and add 01 to get the first day of the month, then minus a day in the DateTimeCalculator. Use a DateTimeConverter first if you need to get the date in FME format

image

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.

2 replies

ebygomm
Influencer
Forum|alt.badge.img+45
  • Influencer
  • Best Answer
  • February 21, 2023

Assuming your date is in an FME format, i.e. 20230221, take the first 6 digits and add 01 to get the first day of the month, then minus a day in the DateTimeCalculator. Use a DateTimeConverter first if you need to get the date in FME format

image


  • Author
  • February 21, 2023

Absolutely brilliant, it worked .Thank you so much !