Leap year finder

am getting an error saying “value of type boolean() cannot be converted to boolean”.
i gave a condition as {(Year mod 4 = 0 )and ( Year mod 100<>0) or (Year mod 400 = 0) }.help me

Hi,

Can you try IsLeapYear method as the following expression?

DateTime.IsLeapYear(varYear)

image

Regards,

1 Like

But i want to do it using if statement

HI,

We can use it in IF activity as the following.

image

Or we can also use it in IF operator

if(DateTime.IsLeapYear(varYear),"A","B")

Regards,

1 Like

Am using the studio latest version… It’s showing something like this

Give a try with

((Now.Year mod 4 = 0) and (Now.Year mod 100 <> 0)) or (Now.Year mod 400 = 0)

Regards!

Hi,

Can you try to choose (use) “Open in Advanced Editor” instead of “Condition Builder”, then input the expression directly?

img20230420-1

Regards,

Copy this and paste it into your expression editor. “)” is missing before the “or” operation.

Try this @Suthari_RohithReddy

DateTime.IsLeapYear(Now.Year)

@Suthari_RohithReddy ,
Remove {} and give a try

(Year mod 4=0) and (Year mod 100<>0) or (Year mod 400=0)

Regards,