how to convert time into 24 Hrs format and remove ":" from time

vishal812

New Member
Hi,

I want to rename one folder with date and time. syntax of the folder is <ddmmyyyy)_<hhmmss). I am able to get the time but that's not in 24 Hrs format.Also i want to remove ":" from time.

Thanks
 

anisjolly

Administrator
Hi @vishal812

You'd need to use the Replace function within a calculation stage to create a brand new name for your file, where the Replace function will be used to remove the colon symbol. Use double-quotes (as null) to replace the : symbol
 

vishal812

New Member
Thanks anisjolly for reply. I have another query of converting time to 24 hrs format. I am able to get the current time but it's in AM/PM format. I want to convert it to 24 Hrs format.
 

anisjolly

Administrator
Hi again @vishal812

You can achieve that by using a calculation stage and using the DateTime functions. You can use the help functions in Blue Prism to find the correct use of hh and HH. I'm sure HH is referencing 24 hour formatting.

I'd also recommend reading up on formatting date and time using VB / Excel to help you.
 

dallangoldblatt

New Member
I believe the following will calculate the text that you want: "logs_" & FormatDateTime(Now(), "ddMMyyyy_HHmmss")
The return value of Now() may be in UTC or local time depending on your environment.
 

anisjolly

Administrator
Good share @dallangoldblatt

I'd recommend to use LocalTime() rather than Now() - as you'll find it's more accurate, and possibly saves issues with certain time related problems that are caused by server settings etc.
 
Top