Skip to main content

Notifications

Power Automate - General Discussion
Answered

Add time field to date field to format as DD-MM-YYYY T HH:mm:ss

(0) ShareShare
ReportReport
Posted on by 295

I have a date field with format dd-mm-yyyy and a time field with hh:mm:ss and create a calculated field Start Date as DD-MM-YYYY T hh:mm:ss and also another calculate date field as End Date : Start Date + Time field(another time field)
This date value are meant to be push into date field of Sharepoint list item.
Please help, I'm struggling with the right expression

  • Verified answer
    Srini007 Profile Picture
    Srini007 2,879 on at
    Re: Add time field to date field to format as DD-MM-YYYY T HH:mm:ss

    Hi @apeawakening 

     

    It depends on the sharepoint list column, If it is a string column, then no issues, it can be pushed, else if it is a DateTime column then you might put another step by the below expression

     

    formatDateTime(variables(‘ReformattedDateTime’), ‘yyyy-MM-ddTHH:mm:ssZ’)

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Cheers,

    Srini

  • Ape Awakening Profile Picture
    Ape Awakening 295 on at
    Re: Add time field to date field to format as DD-MM-YYYY T HH:mm:ss

    @Srini007 , thank you so much .
    I was just wondering will this ReformattedDateTime will get pushed into Sharepoint list item ?

  • Srini007 Profile Picture
    Srini007 2,879 on at
    Re: Add time field to date field to format as DD-MM-YYYY T HH:mm:ss

    Hi @apeawakening 

     

    Try as below

     

    Initialize variable: DateField = 13-05-2024
    Initialize variable: TimeField = 10:00:00

    Set variable: Day = split(variables('DateField'),'-')[0]
    Set variable: Month = split(variables('DateField'),'-')[1]
    Set variable: Year = split(variables('DateField'),'-')[2]

    Set variable: Hour = split(variables('TimeField'),':')[0]
    Set variable: Minute = split(variables('TimeField'),':')[1]
    Set variable: Second = split(variables('TimeField'),':')[2]

    Set variable: ReformattedDateTime = concat(variables('Day'), '-', variables('Month'), '-', variables('Year'), 'T', variables('Hour'), ':', variables('Minute'), ':', variables('Second'))

    Output: ReformattedDateTime (2022-04-23T10:00:00)

     

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Cheers,

    Srini

     

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,304

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard