Hi @kanha123_456 !
Two methods I propose:
Method 1:
Just fix the format like below:

M/d/yyyy hh:mm:ss tt
Method 2:
Do it using this simple approach. Just one PowerShell action to fix everything.
Incase your variable comes in as "6/1/2024 12:00:00 AM", we can use PowerShell to put 0 in for the month and date in front. I have just added one action only and PowerShell will do the magic for you. Use this flow:

PowerShell script:

# Original date string
$originalDateString = "%TransactionItemData%"
# Convert the original string to a DateTime object
$dateTime = [datetime]::ParseExact($originalDateString, "M/d/yyyy h:mm:ss tt", $null)
# Reformat the DateTime object to the desired format
$formattedDateString = $dateTime.ToString("MM/dd/yyyy hh:mm:ss tt")
# Output the formatted date string
$formattedDateString
Full code of the flow (just copy paste this into your flow):
SET TransactionItemData TO $'''6/1/2024 12:00:00 AM'''
@@copilotGeneratedAction: 'False'
Scripting.RunPowershellScript.RunPowershellScript Script: $'''# Original date string
$originalDateString = \"%TransactionItemData%\"
# Convert the original string to a DateTime object
$dateTime = [datetime]::ParseExact($originalDateString, \"M/d/yyyy h:mm:ss tt\", $null)
# Reformat the DateTime object to the desired format
$formattedDateString = $dateTime.ToString(\"MM/dd/yyyy hh:mm:ss tt\")
# Output the formatted date string
$formattedDateString''' ScriptOutput=> TransactionItemData ScriptError=> ScriptError
Text.Trim Text: TransactionItemData TrimOption: Text.TrimOption.Both TrimmedText=> TransactionItemData
SET benPlanExpDate TO TransactionItemData
Text.ConvertTextToDateTime.ToDateTimeCustomFormat Text: benPlanExpDate CustomFormat: $'''MM/dd/yyyy 12:00:00 tt''' DateTime=> TextAsDateTime
Text.ConvertDateTimeToText.FromCustomDateTime DateTime: TextAsDateTime CustomFormat: $'''M/dd/yyyy''' Result=> FormattedDateTime
This will work for both formats:
"6/1/2024 12:00:00 AM"
"11/16/2024 12:00:00 AM"
Output:
For "6/1/2024 12:00:00 AM"

For "11/16/2024 12:00:00 AM"

I hope this helps.