Skip to main content

Notifications

Power Automate - Building Flows
Answered

DateTime and SQL Help!

(0) ShareShare
ReportReport
Posted on by 194
Hi Everyone
I have a flow that is pulling a LastModifiedOn column that is a DateTime in SQL on TABLE-A and updating another SQL table in the LastModifiedOn DateTime on TABLE-B.
 
Table-A DateTime is accurate as to when things happened, but when the flow runs to grab that datetime and put it in the other table it keeps adding 'Z' to the end and thus converting it to UTC. The time is 5 hours behind the time it's supposed to show. I tried to format doing these two methods and no change.:
 
 
formatDateTime(convertFromUtc(triggerOutputs()?['body/LastModifiedOn'], 'Eastern Standard Time'), 'yyyy-MM-ddTHH:mm:ss')
 
and I also tried this:
 
convertFromUtc(triggerOutputs()?['body/LastModifiedOn'], 'Eastern Standard Time')
 
 
 
Please help! When I run the flow it still shows 5 hours back with the Z at the end despite what the column from TABLE-A is showing.
  • Verified answer
    Nicci Profile Picture
    Nicci 194 on at
    DateTime and SQL Help!
    Just in case this helps others, I finally figured it out! The correct thing to do is:
     
    formatDateTime(triggerOutputs()?['body/LastModifiedOn'], 'yyyy-MM-ddTHH:mm:ss')
     
    Just format it! I saw the Z so i just assumed it was converting to UTC, but if I format it then it doesnt convert, my original was just pointing to the column which for some reason it was converting to UTC, but formatting stopped it from converting and pulled the datetime from one and into the next. yay!
  • David_MA Profile Picture
    David_MA 8,950 on at
    DateTime and SQL Help!
    I don't do anything with updating SQL tables, but have your tried to copy the data by itself without an expression? If you were doing this with SharePoint, if you convert the time zone when you copy the data from one SharePoint list to another, what you say is happing would occur because SharePoint saves dates in the UTC format.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard