module Runway::TimeHelpers

Defined in:

runway/lib/time.cr

Class Method Summary

Class Method Detail

def self.interval(interval : String) : Time::Span #

Constructs a Time::Span object from an interval pattern.

@param interval [String] The interval pattern to construct the Time::Span object from. Example string: "1m" for 1 minute. Intervals must be in the format of a number followed by a unit of time (ms, s, m) and be whole numbers. @return [Time::Span] The Time::Span object for the interval pattern.


[View source]
def self.timezone(timezone : String | Nil) : Time::Location #

Gets the timezone for a schedule.

@param timezone [String, nil] The timezone to use for the schedule, or nil for UTC. Example string: "America/New_York". @return [Time::Location] The Time::Location object for the timezone.


[View source]