- to_s
Timestamp formatting
examples/time/formatting.cr
time = Time.utc(2016, 2, 15, 10, 20, 30) puts time.to_s("%Y-%m-%d %H:%M:%S %:z") puts time.to_s("%Y-%m-%d")
2016-02-15 10:20:30 +00:00 2016-02-15
time = Time.utc(2016, 2, 15, 10, 20, 30) puts time.to_s("%Y-%m-%d %H:%M:%S %:z") puts time.to_s("%Y-%m-%d")
2016-02-15 10:20:30 +00:00 2016-02-15