Timezone MDT not supported for parsing (yet it works for formatting)

オープン
#686 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
elixir
領域
backend

調査の方向性

まず、issue にある DateTime.new、Timex.format、Timex.parse の例を実行し、MDT のフォーマット処理とパース処理の経路を比較します。タイムゾーンの略称がどのように解決されるかを追跡し、そのうえで、フォーマットされた America/Denver の値を MDT と MST の両方について同等の DateTime にパースし直せることを確認します。

索引モデルが issue の本文から書いたものです。

説明

Steps to reproduce
format_str = "{YYYY}-{M}-{D} {h24}:{m}:{s} {Zabbr}"
{:ok, datetime} = DateTime.new(~D[2021-09-13], ~T[00:00:00.000], "America/Denver")
{:ok, d } = Timex.format(datetime, format_str) # this outputs MDT as the timezone, but it cannot parse the datetime back from that string.
IO.puts d # => "2021-9-13 00:00:00 MDT"
IO.inspect Timex.parse(d, format_str) # => {:error, :time_zone_not_found}
Description of issue
  • Using the same input string, the formatted output should be able to be re-parsed to a date time.
  • Clearly the library recognizes MDT as a valid date time because I do not have MDT anywhere in my code. It is correctly converting from America/Denver to MDT, but it cannot parse it back from MDT again.
  • In the above example, the output of d should match the input of datetime. I believe the format call will return MDT part of the year and MST part of the year, but the end result or parsing it again should still return the same DateTime
主要言語
Elixir
スター
1.8k
フォーク
408
平均マージ
2時間 8分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bitwalker/timex のほかの issue

bitwalker/timex の issue をすべて見る

似ている issue

Elixir の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。