Forum Discussion
How to add hours to DateTime data?
- 9 years ago
You can add a duration to a datetime field, e.g. if your fieldname is "DateTime":
[DateTime] + #duration(0,10,0,0))
The arguments of#duration are days, hours, minutes, seconds.
In the code below I copied your line without any modification and it works fine.
let
Source = {40000..40001},
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type date}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "adx_releasedate"}}),
adx_events = #"Renamed Columns"{0},
StartDate = (adx_events[adx_releasedate] + #duration(0,10,0,0))
in
StartDate
You can copy/paste this code into your query editor and see for yourself.
Hi
How do you add 10hrs to all dates in the list instead of just one?
- quinncallan9 years agoNew Member
My apologies, i believed my question was still on topic, asking a question about your answer and would enhanse the existing thread
- MarcelBeug9 years agoCommunity Champion
Please don't hijack other topics for your own question, but start a new topic instead.
And don';t forget to react to replies you get, maybe give kudos, mark replies as answer, which you still have to do for your for your first and only topic so far, raised in April 2016.