ToUniversalTime() is not working in online TryFSharp
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- fsharp
- 领域
- web-dev
调研方向
首先在本地 FSI 和 https://try.fsharp.org/ 中分别运行提供的 DateTime 示例,比较 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
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fsharp/TryFSharp 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 25/100
-
难度 5/5 一周以上 新手友好度 15/100
-
难度 3/5 1-2 天 新手友好度 38/100
-
难度 4/5 3-5 天 新手友好度 25/100
-
难度 3/5 1-2 天 新手友好度 25/100
相似的 Issue
-
agent-canvas bug priority:low ready-for-dev
难度 1/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
🐛 bug
难度 2/5 1-3 小时 新手友好度 61/100
spicetify/marketplace#1262 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
LuciusChen/clutch#90 · 1 条评论 ·
维护者通常 1 天内回复
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1 小时以内 新手友好度 88/100
lingdojo/kana-dojo#31665 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
jessepollak/home#2003 ·
维护者通常 1 天内回复