Skip to content

Instantly share code, notes, and snippets.

@kinuasa
Created October 19, 2023 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kinuasa/4b53065c43248eae041bedc53094dd18 to your computer and use it in GitHub Desktop.
Save kinuasa/4b53065c43248eae041bedc53094dd18 to your computer and use it in GitHub Desktop.
和暦を西暦に変換するPower Automate for desktopフロー(全角対応)
/# ☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
和暦を西暦に変換するフロー(全角対応)
Power Automate for desktop バージョン 2.37.00181.23279 で動作確認
☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#/
SET NewVar TO $'''令和5年10月19日 01:23:45'''
/# ☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
全角文字と半角文字の対応表を用意してループで置換
※必要に応じて文字は追加
☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#/
SET StringTable TO { ^['FullWidth', 'HalfWidth'], ['0', 0], ['1', 1], ['2', 2], ['3', 3], ['4', 4], ['5', 5], ['6', 6], ['7', 7], ['8', 8], ['9', 9], [' ', ' '], ['/', '/'], [':', ':'], ['.', '.'] }
LOOP LoopIndex FROM 0 TO StringTable.RowsCount - 1 STEP 1
Text.Replace Text: NewVar TextToFind: StringTable[LoopIndex]['FullWidth'] IsRegEx: False IgnoreCase: False ReplaceWith: StringTable[LoopIndex]['HalfWidth'] ActivateEscapeSequences: False Result=> NewVar
END
Text.ConvertTextToDateTime.ToDateTime Text: NewVar DateTime=> TextAsDateTime
Display.ShowMessageDialog.ShowMessage Message: TextAsDateTime Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment