Specifies the format to convert a Time
to and from a String
.
The pattern of a format is a String
with directives. Directives being with a percent (%
) character. Any text not listed as a directive will be passed/parsed through the output/input string.
The directives are:
%9N
but may consume more than 9 digits while parsing)Time#to_unix
)Creates a new Time::Format
with the given pattern.
Formats a Time
into the given io.
Parses a string into a Time
.
Returns the string pattern of this format.
Struct
Value
Object
Object
Creates a new Time::Format
with the given pattern. The given time location will be used when parsing a Time
and no time zone is found in it.
© 2012–2020 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.35.1/Time/Format.html