Warning! This documentation is a work in progress. Expect things to be out of date and not actually work according to instructions.
Date and Time
Using Java 8’s ZonedDateTime is the preferred way to handle all date and time issues. There is a helper class io.stallion.utils.DateUtils which provides some helper methods:
ZonedDateTime now = DateUtils.utcNow();
// Get milliseconds since the epoch
Long epochMillis = DateUtils.mils();
// Get the time in the local time zone, based on `timeZoneId` setting in `stallion.toml`
ZonedDateTime now = DateUtils.localNow();
// Format either a ZonedDateTime or milliseconds time stamp using the local
// timezone and the passed in format
DateUtils.formatLocalDate(dateOrTimeStamp, "YYYY-MM-dd-HHmm-ssSS");
© 2024 Stallion Software LLC