Forum Discussion
lkshck
4 years agoHelper III
Last Refresh Date change Timezone
Hey, I added a new Table with one column to my report which should show the Last Refresh Date. I've created it with the following query: let
Source = #table(type table[Date Last Refreshed=datetime...
- 4 years ago
lkshck , I think you should use
Date.From(DateTime.FixedLocalNow())
for timezone refer if this can help
Ash2022
2 years agoHelper I
This is how I used to get the local Date/Time using worldtimeapi.org:
1- Use https://worldtimeapi.org/api/timezone to find your local timezone path/page/API
2- The following Query will convert it into a readable date/time.. Update the WebPage path
let
Source = Json.Document(Web.Contents("https://worldtimeapi.org/api/timezone/America/Toronto")),
#"Converted to Table" = Record.ToTable(Source),
#"Pivoted Column" = Table.Pivot(#"Converted to Table", List.Distinct(#"Converted to Table"[Name]), "Name", "Value"),
#"Removed Other Columns" = Table.SelectColumns(#"Pivoted Column",{"datetime"}),
#"Replaced Value" = Table.ReplaceValue(#"Removed Other Columns","T"," ",Replacer.ReplaceText,{"datetime"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value",each [datetime],each Text.Split([datetime]," "){0} & " " & Text.Split(Text.Split([datetime]," "){1},"-"){0},Replacer.ReplaceValue,{"datetime"}),
#"Changed Type" = Table.TransformColumnTypes(#"Replaced Value1",{{"datetime", type datetime}})
in
#"Changed Type"