How To Convert TimeStamp To 12/24hrs Format In UiPath

Different processes may demand different DateTime format based on their standards.

Let’s see how to do that…

1.DateTime in 12-hour format
2.DateTime in 24-hour format


1.DateTime in 12-hour format

Now.ToString(“h:mm:ss tt”)

Where,

  • Now = Gives Current Date and Time
  • ToString(“h:mm:ss tt”) = Converts the Current Date and Time to 12 hours format

Implementation using UiPath :

Drag a “Message box” activity into the design panel and type the above code.

UiPath Date 12 hours format


2.DateTime in 24-hour format

Now.ToString(“HH:mm:ss tt”)

Where,

  • Now = Gives Current Date and Time
  • ToString(“HH:mm:ss tt”) = Converts the string to 24 hours format

Implementation using UiPath :

Drag a “Message box” activity into the design panel and type the above code.

UiPath Date 24 hours format

Click here to download the Source Code…

Hope it has helped you… 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: