How to check the quarter month

Hi,
First I need to check if my date belongs in the quarter(first: 01.01-31.03, second: 01.04-30.06,…). Then I need to check if today’s day is after 23.4. how can I do that? Please help me I don’t know how to check if I have many dates.

Hi,

The following expression returns today belongs Nth quarter as Int32.

Math.Floor(DateTime.Today.Month/4)+1

We can use the following to check if today is after 23.4 in If condition.

DateTime.Today > new DateTime(2020,4,23)

Regards,

2 Likes

Is not working for me, for 7 I get 2 quarter, for 10 I get 3 quarts.

Hi,

Sorry, I had a mistake. The following will work.

Math.Floor((DateTime.Today.Month-1)/3)+1

Regards,

4 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.