How to change the date format

excel
activities

#1

hi
as my date format is dd/mm/yyyy but while am pasting to excel file the format gets change to
mm/dd/yyyy…can help me out with this.


Conversion: mm/dd/yyyy hh: mm: ss > yyyy/mm/dd
#2

Hi @sanjay21051990,

Try this code

DateTime.ParseExact(YourDateString.ToString(),"dd/MM/yyyy",Globalization.CultureInfo.InvariantCulture).ToString("MM/dd/yyyy")

Regards,
Arivu


#3

hi @arivu96
i want in this format dd/mm/yyyy but while writing into cell the format gets change to mm/dd/yyyy…so how should i over come this to get the same format dd/mm/yyyy?


#4

if i wirte in this way ‘(DD/MM/yyy) it works but i need without (’).


#5

use the above code
Inputpattern :dd/MM/yyyy
outputpattern :MM/dd/yyyy
DateTime.ParseExact(YourDateString.ToString(),Inputpattern,Globalization.CultureInfo.InvariantCulture).ToString(outputpattern)

Regards,
Arivu


How to extract only Date from the received email
The correct form to paste Date with "Type Into"
#6

@sanjay21051990

DateTime.ParseExact(YourDateString.ToString(),“dd/MM/yyyy”,Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)

Regards,
Mahesh


#7

So Excel is changing it for you?
If yes, Check your regional settings, as it’s not related to Uipath but to Excel itself.