I am creating a flow in Power Automate Desktop (version 2.57.184.25154) to retrieve the datetime one month prior to the current date.
For example:
If the current month is 202506, I want to get 202505.
I used the "Get current date and time" action to generate a datetime-type variable,
and passed it to the "Subtract dates" action.
However, the following error is displayed:
Error message:
The argument 'SubtractDate' must be of type 'Datetime'.
The variable is recognized as a Datetime value, and I believe its type is correct.
I have tried:
Renaming the variable
Restarting Power Automate Desktop
Reinstalling the application
But the same error continues to occur.
Below is the structure of the flow:
Get current date and time → %現在日時_raw%
Subtract dates → %現在日時_raw%
minus 31 days → %前月日時%
I would appreciate it if you could provide any possible causes or similar known issues.
DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateAndTime CurrentDateTime=> CurrentDateTime
DateTime.Add DateTime: CurrentDateTime TimeToAdd: -1 TimeUnit: DateTime.TimeUnit.Months ResultedDate=> ResultedDate
Text.ConvertDateTimeToText.FromCustomDateTime DateTime: ResultedDate CustomFormat: $'''yyyyMM''' Result=> FormattedDateTime
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492