英文:
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
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"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论