DateTime.Today.AddDays(-1).ToString("dd/MM/yyyy")
DateTime dt1 = DateTime.Today;
DateTime dt2 = DateTime.ParseExact("10/01/2017", "dd/MM/yyyy", CultureInfo.InvariantCulture);
int daysToAdd = (int)dt1.Subtract(dt2).TotalDays;
Hey,Take a look in the file "ProcessComponent.cs", and take a look at how respects our given to the users each day.
You'll want to create something similar to that system, or do what I did and recycle the code into one check. Progress the duration achievement every day, and for the login streak do a check to see if the user was last logged in yesterday otherwise reset it.
I'm not going to spoon feed you but he's some information that'll help you achieve your goal.
Used to get the previous date to string:
Code:DateTime.Today.AddDays(-1).ToString("dd/MM/yyyy")
Used to get the date between two DateTimes (use this for the duration achievement to calculate when the user was last on):
Code:DateTime dt1 = DateTime.Today; DateTime dt2 = DateTime.ParseExact("10/01/2017", "dd/MM/yyyy", CultureInfo.InvariantCulture); int daysToAdd = (int)dt1.Subtract(dt2).TotalDays;
Peace!