diff options
author | Nicholas Johnson <koihimenakamura@gmail.com> | 2017-11-08 22:52:34 -0800 |
---|---|---|
committer | Nicholas Johnson <koihimenakamura@gmail.com> | 2017-11-08 22:52:34 -0800 |
commit | 4aa3545b58ccda79863d8d2136904f2ff0995cfb (patch) | |
tree | d560b4ec155ed0ed44a84e950746ecdf086be490 /src | |
parent | a6071feaf84518c436fba0d148e3ea7d547663da (diff) | |
download | SMAPI-4aa3545b58ccda79863d8d2136904f2ff0995cfb.tar.gz SMAPI-4aa3545b58ccda79863d8d2136904f2ff0995cfb.tar.bz2 SMAPI-4aa3545b58ccda79863d8d2136904f2ff0995cfb.zip |
Adding a date function
Diffstat (limited to 'src')
-rw-r--r-- | src/SMAPI/Utilities/SDate.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/SMAPI/Utilities/SDate.cs b/src/SMAPI/Utilities/SDate.cs index 2630731a..126673eb 100644 --- a/src/SMAPI/Utilities/SDate.cs +++ b/src/SMAPI/Utilities/SDate.cs @@ -95,6 +95,12 @@ namespace StardewModdingAPI.Utilities return $"{this.Day:00} {this.Season} Y{this.Year}"; } + /// <summary>This function will return the number of days since Year 1 Spring 0 for an arbitrary date</summary> + public static int TotalNumberOfDays(SDate date) + { + return (((date.Year - 1) * 112) + (date.GetSeasonIndex() * 28) + date.Day); + } + /**** ** IEquatable ****/ |