Add the following code to your project's shard.yml under:
dependencies
to use in production
- OR -
development_dependencies
to use in development
The TimeZone
class serves as a helper to work with time zones in Crystal.
It allows to do the following:
Add the dependency to your shard.yml
:
dependencies:
time_zone:
github: mamantoha/time_zone
Run shards install
require "time_zone"
zone = TimeZone.new("Taipei")
zone # => #<TimeZone:0x102b64f00 @name="Taipei", @location=#<Time::Location Asia/Taipei>, @utc_offset=28800>
puts zone
# (GMT+08:00) Taipei
zone.local # returns the current time in time zone "Asia/Taipei"
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)