I need to change the date format which comes from Excel sheet

Hi Team,

i have a transaction item in Queue with TranscationDate-2023-10-11 00:00:00.0 in this format but in the application it takes 11-OCT-2023.

How to convert the date format

Thanks
Likitha

@vinjam_likitha

inputDate = DateTime.ParseExact(“2023-10-11 00:00:00.0”, “yyyy-MM-dd HH:mm:ss.f”, CultureInfo.InvariantCulture)

outputDate = inputDate.ToString(“dd-MMM-yyyy”, CultureInfo.InvariantCulture)

Hi @vinjam_likitha

have you tried with format cell activity

  1. Use the Get Transaction Item activity to retrieve the transaction item from the queue.
  2. Extract the transaction date from the item.
  3. Use the DateTime.ParseExact method to convert the date to the desired format

Check out this threads @vinjam_likitha

https://forum.uipath.com/search?q=format%20cell%20%40Gokul001

Regards

@vinjam_likitha

You can convert the date format from “2023-10-11 00:00:00.0” to “11-OCT-2023”

convertedDate = DateTime.ParseExact("2023-10-11 00:00:00.0", "yyyy-MM-dd HH:mm:ss.f", CultureInfo.InvariantCulture).ToString("dd-MMM-yyyy").ToUpper()

cheerss…!

Hi @vinjam_likitha


DateTime.ParseExact(InputDate,"yyyy-MM-dd HH;mm:ss.f",System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MMM-yyyy")

Hi @vinjam_likitha

Assign Activity

To:originalDate
Value:"2023-10-11 00:00:00.0"
To: newDate
Value: DateTime.ParseExact(originalDate, "yyyy-MM-dd HH:mm:ss.f", System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MMM-yyyy").ToUpper()

Hope it helps!!

@vinjam_likitha
inputDateFormat =yyyy-MM-dd HH:mm:ss.0
outputDateFormat= dd-MMM-yyyy

Assign TransactionDate=transactionDate

 DateTime.ParseExact(item.SpecificContent("TranscationDate").ToString, inputDateFormat, 

System.Globalization.CultureInfo.InvariantCulture).ToString(outputDateFormat)

Hello,
Please refer the below screenshot for datetime conversion.

Thanks.