年月日は個別に年、月、日、時間、分、秒を1件ずつテキストボックスで入力させるしかない?

こんばんは
UiPath Studio 2025.0.161 community editionのユーザです。

フォームを表示アクティビティで、新規フォームを作成中です。

年月日をyyyy-MM-dd hh:mm:ss または yyyy/MM/dd hh:mm:ssの形式で入力させたいのですが、無理で
個別に年、月、日、時間、分、秒を1件ずつテキストボックスで入力させるしかないでしょうか?

こんにちは

形式をそのように設定すれば良いかと思います。

@gorby

If your variable type is datetime then you can all details individually
by writing like datetimVar.year, like month,date, hour, min, sec. refer below expression
strDatetime.Year.ToString + Environment.NewLine +strDatetime.Month.ToString +Environment.NewLine +strDatetime.Day.ToString + Environment.NewLine+ strDatetime.Hour.ToString+Environment.NewLine + strDatetime.Minute.ToString+ Environment.NewLine+strDatetime.Second.ToString

if you datetime variable is string format try convert to datetime format

Happy automation!!

Hi @gorby

If you prefer the individual inputs for each part (year, month, day, hour, minute, second), you can create multiple text boxes and then combine them into a DateTime object in your workflow. Afterward, you can reformat it into the desired string format.

OR

Use a single text box for the user to input the date and time in the format yyyy-MM-dd hh:mm:ss. Validate the input with a regex pattern (^\d{4}[-/]\d{2}[-/]\d{2} \d{2}:\d{2}:\d{2}$), then parse the string to a DateTime object using DateTime.ParseExact() for further processing.