Skip to main content

Notifications

Power Automate - General Discussion
Answered

How to Convert CultureInfo String Datetime to Datetime

(0) ShareShare
ReportReport
Posted on by 20

Hello all!

 

I have a string "8 Kasım 2024 Cuma 10:21:47" Turkish format string in PAD. I want to have a datetime format of this string. Please help me. I appriciate that.

  • Verified answer
    betuld Profile Picture
    betuld 20 on at
    Re: How to Convert CultureInfo String Datetime to Datetime

    I used powershell prompt. And it worked!
    "# Gelen string değer
    $stringValue = "%AttributeValue%"

    # String değeri DateTime nesnesine dönüştürme
    $dateTime = [DateTime]::ParseExact($stringValue, "d MMMM yyyy dddd HH:mm:ss", [System.Globalization.CultureInfo]::GetCultureInfo("tr-TR"))

    # Yeni formata göre tarih ve saat değerini string olarak biçimlendirme
    $newFormattedString = $dateTime.ToString("dd.MM.yyyy HH:mm:ss", [System.Globalization.CultureInfo]::GetCultureInfo("tr-TR"))

    Write-Output $newFormattedString"

  • betuld Profile Picture
    betuld 20 on at
    Re: How to Convert CultureInfo String Datetime to Datetime

    Yes, it doesn't work. because of language i think . I select Custom and typed d MMMM yyyy dddd HH:mm:ss

     

  • Srini007 Profile Picture
    Srini007 2,902 on at
    Re: How to Convert CultureInfo String Datetime to Datetime

    Hi @betuld 

     

    Did you get a chance to look at Convert text to datetime action available in PAD

     

    Srini007_0-1715607253805.png

     

     

    Check below link for documentation

     

    https://learn.microsoft.com/en-us/power-automate/desktop-flows/actions-reference/text#converttexttodatetime

     

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

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,822

Leaderboard