Forum Discussion

steph94's avatar
steph94
New Member
4 years ago
Solved

datetime.localnow() returns 'a datetime value set to the current date and time on the system.'

Hi, quick question.. datetime.localnow() returns 'a datetime value set to the current date and time on the system.' My question is which system? I'v had such mess with shceduling a refresh on a report and it appears that it may be a result of the times on the sharepoint list the report is using, are by default in UTC rather than my local time..? I schedule refresh my report after midnight which in turn updates which jobs in the report are displayed as 'Active'. However the datetime.localnow might be returning the local UTC time rather than my timezone which is GMT.. This is the query for context: Table.AddColumn(#"Changed Type", "Today Active/Not Active", each if DateTime.Date(DateTime.LocalNow())=[Project Start] then "Active" else if DateTime.Date(DateTime.LocalNow())>[Project Start] and DateTime.Date(DateTime.LocalNow())<=[Projected Finish] then "Active" else "Not Active") Any advice or ideas would be really helpful!

  • Yes times in the powerBI service are UTC
    And yes it's super annoying
    You can wrap it in a time zone conversion though

2 Replies

  • RayWu's avatar
    RayWu
    Memorable Member

    Yes times in the powerBI service are UTC
    And yes it's super annoying
    You can wrap it in a time zone conversion though