Skip to main content
Solved

Today is 3rd Friday this month

  • September 21, 2019
  • 3 replies
  • 11 views

hlouie
Contributor
Forum|alt.badge.img+16

Today is 2019-SEP-20

%Y = 2019 / Year

%b = Sep / Month

%a = Fri / Day Name

%d = 20 / Day

%u = 37 / Week of Year

??? = 3 (3rd Friday of September)

What I'm trying to find this is the 3rd Friday this month?

ie

2019-SEP-06 is the 1st Friday of September

2019-SEP-13 is the 2nd Friday of September

2019-SEP-30 is the 3rd Friday of September

2019-SEP-27 is the 4th Friday of September

Best answer by takashi

Hi @hlouie, I don't think there is a single function to return your required text, but you can achieve that with some FME String, Math, and Date/Time functions. e.g. assuming that an attribute called "_date" stores a date value formatted with %Y-%b-%d (e.g. "2019-SEP-20")

See these documentations to learn more about those functions.

Result:

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.

3 replies

danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Celebrity
  • September 21, 2019

Hi @hlouie

 

Do you if there is a python code to do this operation?

 

Thanks in Advance,

Danilo


hlouie
Contributor
Forum|alt.badge.img+16
  • Author
  • Contributor
  • September 21, 2019

Yes, but I wanted to check out pure FME first.

datetime.datetime(2011, 8, 15) // should return 3
datetime.datetime(2011, 2, 28) // should return 5
datetime.datetime(2011, 8, 29) // should return 5

takashi
Celebrity
  • Best Answer
  • September 21, 2019

Hi @hlouie, I don't think there is a single function to return your required text, but you can achieve that with some FME String, Math, and Date/Time functions. e.g. assuming that an attribute called "_date" stores a date value formatted with %Y-%b-%d (e.g. "2019-SEP-20")

See these documentations to learn more about those functions.

Result: