This wiki is a read-only version of the Stardew Valley Wiki. The official editable wiki maintained by ConcernedApe can be found at stardewvalleywiki.com

Changes

Jump to: navigation, search

Modding:Modder Guide/APIs/Utilities

385 bytes added, 02:00, 29 June 2020
Dates: update for newer SMAPI versions
var date = new SDate(28, "spring"); // date in the current year
var date = new SDate(28, "spring", 2); // date in the given year
var date = SDate.From(Game1.Date); // from a game date
</source>
if (a < b) // true
...
</source>
 
...and get a translated date string:
<source lang="c#">
var date = new SDate(15, "summer");
string message = $"See you on {date.ToLocaleString(withYear: false)}!"; // See you on Summer 15!
</source>
| <tt>Season</tt>
| The normalised season name.
|-
| <tt>SeasonIndex</tt>
| The zero-based season index recognised by game methods like <tt>Utility.getSeasonNameFromNumber</tt>.
|-
| <tt>Year</tt>
Protected, translators
5,421
edits

Navigation menu