Cody Engel
04/18/2019, 3:34 PMOffsetDateTime
where I’d be able to do something like OffsetDateTime.todayAtMidnight
to get the time for today at midnight. If I could do an extension static function on that class then my problem would be solved but alas I don’t think you can do that.
Would the best option be to just use the factory pattern and have a OffsetDateTimeFactory
that’s just a collection of ways to create OffsetDateTime
instances for specific cases?rook
04/18/2019, 3:56 PMtodayAtMidnight()
that just returns what you’re looking for. fun todayAtMidnight() = OffsetDateTime.now().withHour(0).withMinute(0).withSecond(0)
Cody Engel
04/18/2019, 5:49 PM