ToUniversalTime() is not working in online TryFSharp
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- fsharp
- 領域
- web-dev
調査の方向性
まず、提供されている DateTime の例をローカルの FSI と https://try.fsharp.org/ の両方で実行し、ToUniversalTime()、等値性、フォーマット済み出力を比較します。System.DateTime とブラウザーのタイムゾーンを処理するオンライン実行経路を追跡します。完了の条件は、オンラインの結果が期待どおりに現地時間と UTC を区別することです。
索引モデルが issue の本文から書いたものです。
説明
Not sure whether or not this is a true bug or not, i.e. maybe it's caused by how date and time are dealt with in browsers, but it does lead to differences in how code works in local FSI vs online FSI.
Example code
open System
let x = DateTime.Now
let y = x.ToUniversalTime()
x.Equals y |> printfn "%A" // should be false
x = y |> printfn "%A" // should be false
printfn "%A" x // should be X hours before/after UTC
printfn "%A" y // should be UTC
Expected output
If you run this, it should output the following (which is what you'll see when running it locally in FSI, except that in UK the times may actually be equal, anywhere else they should be different):
false
false
2/18/2022 6:37:54 PM
2/18/2022 5:37:54 PM
Actual output on https://try.fsharp.org/
However, it outputs this, note specifically the differences in how the %A outputs the time (which may be due to system wide settings on the machine, so not that big a deal), and, most importantly, that ToUniversalTime() did not change the time to UTC, instead the time variable remained unchanged.
true
true
Fri Feb 18 2022 17:09:41 GMT+0100 (Central European Standard Time)
Fri Feb 18 2022 17:09:41 GMT+0100 (Central European Standard Time)
- 主要言語
- F#
- スター
- 25
- フォーク
- 14
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fsharp/TryFSharp のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
-
Update to .NET 6? オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
fsharp/TryFSharp の issue をすべて見る
似ている issue
-
Browser (wasm) relay client cannot connect to relays whose URL has a trailing-dot FQDN hostname オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
n0-computer/iroh#4550 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
nightscout/nocturne#1425 ·
-
ui/ux
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
docToolchain/docToolchain#1705 ·