Avatar of whorsfall
whorsfall
Flag for Australia asked on

C# Australian Financial Year

Hi

in C# how can I determine the following:

1. The current Australian financial year of I pass a DateTime

2. Get the the start and end of I financial year if I pass a year start and a yeay end.  like 2 integers. 2020 and 2021 I get back 2 DateTimes which define the start and end date.

FYI financial years go like this in Australia 1st of July - 30th of June in the following year

Thanks
ward
C#

Avatar of undefined
Last Comment
Gustav Brock

8/22/2022 - Mon
ste5an

Read the docs at MSFT or use IntelliSense. It is one of the ctors. DateTime(Int32, Int32, Int32) with a +1 and some constants.
whorsfall

ASKER
hi ste5an can you please give me some more information I don't understand you response. I need some more context and guidance

thanks
ward
ste5an

You simply need to pass the numbers into the constructor of DateTime(). Day and month values are constants for the start and end date. The end year is variable, but defined as start year +1.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER CERTIFIED SOLUTION
Gustav Brock

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.