奇怪的时间格式数据,介于1和2400之间。

huangapple go评论70阅读模式
英文:

Weird time formatted data between 1 and 2400

问题

我正在为一个项目使用一些开放数据,时间字段格式为1到2400之间的整数。我该如何将其转换为普通时间?

(我在这个项目中使用Power Bi)

https://www.kaggle.com/datasets/usdot/flight-delays?resource=download&select=flights.csv

英文:

I'm using some open data for a project and the time fields are formatted as integers between 1 and 2400. How do I convert this into normal time?

(I'm using Power Bi for this project)

https://www.kaggle.com/datasets/usdot/flight-delays?resource=download&select=flights.csv

答案1

得分: 3

The columns seem to be in hour and minute format - HHMM. 0007 being 12.07am and 2315 being 11.15pm.

    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjAwMFeK1YlWMjI2NFWKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Custom", each Time.FromText([Column1],[Format = "HHmm", Culture = "en-GB"]), type time)
in
    #"Added Custom"
英文:

From the comments:

The columns seem to be in hour and minute format - HHMM . 0007 being 12.07am and 2315 being 11.15pm

奇怪的时间格式数据,介于1和2400之间。

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjAwMFeK1YlWMjI2NFWKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Custom", each Time.FromText([Column1],[Format = "HHmm", Culture = "en-GB"]), type time)
in
    #"Added Custom"

huangapple
  • 本文由 发表于 2023年6月13日 16:39:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/76463106.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定