How do I formatDateTime a Select value from SharePoint List?

%3CLINGO-SUB%20id%3D%22lingo-sub-82103%22%20slang%3D%22en-US%22%3EHow%20do%20I%20formatDateTime%20a%20Select%20value%20from%20SharePoint%20List%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-82103%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20SharePoint%20list%20which%20I'm%20retrieving%20daily%20at%204pm.%20%26nbsp%3BI'm%20filtering%20out%20the%20items%20I%20need%20and%20then%20adding%20them%20to%20an%20HTML%20table%20to%20send%20out%20via%20email%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERecurrence%20-%26gt%3B%20Get%20Items%20-%26gt%3B%20Select%20-%26gt%3B%20Create%20HTML%20Table%20-%26gt%3B%20Send%20EMail%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20problem%20I%20have%20is%20that%20one%20of%20the%20fields%20is%20a%20datetime%20field%20and%20is%20showing%20UTC%20time%20when%20it%20should%20be%20showing%20daylight%20savings%20time%20(or%20local%20time).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20can%20I%20format%20this%20field%20so%20that%20it%20shows%20the%20correct%20value%20in%20the%20HTML%20table%3F%20%26nbsp%3BI%20tried%20adding%20the%20formatDateTime%20(which%20might%20do%20it%3F)%20to%20the%20Select%2C%20but%20it%20appears%20that%20is%20just%20expecting%20a%20JSON%20object%2C%20and%20not%20recognising%20functions.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20thoughts%20on%20how%20I%20can%20parse%20that%20JSON%20and%20replace%20the%20datetime%20values%20with%20formatted%20date%20time%20values%20greatly%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMany%20thanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-82103%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-82358%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20I%20formatDateTime%20a%20Select%20value%20from%20SharePoint%20List%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-82358%22%20slang%3D%22en-US%22%3E%3CP%3EOK%2C%20so%20I've%20managed%20to%20get%20the%20formatdatetime%20function%20to%20work%2C%20but%20it%20is%20still%20showing%20the%20UTC%20date%20time%20and%20not%20the%20local%20date%20time.%20%26nbsp%3BAny%20thoughts%3F%20%26nbsp%3BI%20just%20want%20to%20show%20the%20actual%20date%20time%20in%20the%20email%20I%20send!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20the%20function%20I'm%20currently%20using%3A%26nbsp%3B%3C%2FP%3E%3CPRE%3E%40formatdatetime(item()%3F%5B'MeetingStart'%5D%2C'r')%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Contributor

I have a SharePoint list which I'm retrieving daily at 4pm.  I'm filtering out the items I need and then adding them to an HTML table to send out via email:

 

Recurrence -> Get Items -> Select -> Create HTML Table -> Send EMail

 

The problem I have is that one of the fields is a datetime field and is showing UTC time when it should be showing daylight savings time (or local time).

 

How can I format this field so that it shows the correct value in the HTML table?  I tried adding the formatDateTime (which might do it?) to the Select, but it appears that is just expecting a JSON object, and not recognising functions.

 

Any thoughts on how I can parse that JSON and replace the datetime values with formatted date time values greatly appreciated.

 

Many thanks.

1 Reply

OK, so I've managed to get the formatdatetime function to work, but it is still showing the UTC date time and not the local date time.  Any thoughts?  I just want to show the actual date time in the email I send!

 

This is the function I'm currently using: 

@formatdatetime(item()?['MeetingStart'],'r')