Solved

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

  • 21 February 2023
  • 2 replies
  • 55 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.

icon

Best answer by ebygomm 21 February 2023, 12:27

View original

2 replies

Userlevel 1
Badge +21

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

Absolutely brilliant, it worked .Thank you so much !

Reply