ToUniversalTime() is not working in online TryFSharp
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- fsharp
- Ambito
- web-dev
Direzione di ricerca
Inizia eseguendo l'esempio DateTime fornito sia nella FSI locale sia su https://try.fsharp.org/, confrontando ToUniversalTime(), l'uguaglianza e l'output formattato. Traccia il percorso di esecuzione online che gestisce System.DateTime e i fusi orari del browser; il lavoro è completato quando il risultato online distingue l'ora locale da UTC come previsto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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)
- Lingua principale
- F#
- Stelle
- 25
- Fork
- 14
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fsharp/TryFSharp
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
-
Update to .NET 6? Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
Can we have light theme? Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
Tutte le issue di fsharp/TryFSharp
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
radiantearth/stac-browser#1023 ·
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
hub-client: Titlebar refresh Apertabug quarto-hub
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
quarto-dev/q2#721 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
frontend maui-pilot pilot-ask question
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100