putting the date into a variable


I’m trying the get the day of the year from the current system and put that into a variable. It will be used at start up to award the player a prize for playing the game once a day.

I have found how to get the date info using System.DateTime.Now, but don’t know how to get only the current day of the year.

Also if it will on ios, android and pc/mac.

Any help is appreciated. Thanks


int d = (int)System.DateTime.Now.DayOfWeek

You are looking for the DayOfWeek property.