Inconsistent Instant <-> long conversion

オープン 初心者向け
#214 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
72/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
活発
技術スタック
clojure
領域
documentation

調査の方向性

まず t/long と t/instant のドキュメントとdocstringを見つけ、エポック単位についての既存の説明を確認します。t/long は秒を返す一方、t/instant に渡すlongはミリ秒を表すことを明確にします。ドキュメントでこの違いが明示されたら完了です。

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

説明

Hello,

I am currently migrating a codebase away from clj-time and I noticed something relative to Instant and long conversion. My point of reference has been clj-time.coerce/from-long and clj-time.coerce/to-long, which works with milliseconds to/from epoch.

What I observe in Tick is that t/long produces the number of seconds from epoch. Conversely, (t/instant ts) where ts is a long produces the Instant that is ts milliseconds from epoch. The direct consequence is that t/long and t/instant are not inverse functions of each other, and (-> (t/instant) t/to-long t/instant) will give you some date in 1970.

I do not know if either of those functions need to be fixed, and it is difficult to modify a production API anyway, but at least the documentation and docstrings should probably be more explicit.

主要言語
Clojure
スター
646
フォーク
61
平均マージ
17時間 42分
マージ済み PR(30日)
1

環境構築

はじめの一歩

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

juxt/tick のほかの issue

juxt/tick の issue をすべて見る

似ている issue

Clojure の issue をもっと見る

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

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