DateTime.shift_zone-exclamation-mark
You're seeing just the function
shift_zone-exclamation-mark
, go back to DateTime module for more information.
Link to this function
shift_zone!(datetime, time_zone, time_zone_database \\ Calendar.get_time_zone_database())
View Source (since 1.10.0)Specs
shift_zone!(t(), Calendar.time_zone(), Calendar.time_zone_database()) :: t()
Changes the time zone of a DateTime
or raises on errors.
See shift_zone/3
for more information.
Examples
iex> DateTime.shift_zone!(~U[2018-07-16 10:00:00Z], "America/Los_Angeles", FakeTimeZoneDatabase)
#DateTime<2018-07-16 03:00:00-07:00 PDT America/Los_Angeles>
iex> DateTime.shift_zone!(~U[2018-07-16 10:00:00Z], "bad timezone", FakeTimeZoneDatabase)
** (ArgumentError) cannot shift ~U[2018-07-16 10:00:00Z] to "bad timezone" time zone, reason: :time_zone_not_found