How to convert datetime(1/21/2018 00:00:00) into date(1/21/2018)


#1

Hello,

How to convert datetime value for ex…1/21/2018 00:00:00 to 1/21/2018.

Thanks…


#2

Hi,
Try the below code using assign activity

string s = dt.ToString(“dd/MM/yyyy”, CultureInfo.InvariantCulture)

Where, dt is the DateTime variable.

Thanks and regards,
Ananthu


#3

I want date in mm/dd/yyyy format


#4

Download zip file from link I hope it’s useful


#5

String v1 = dt.Tostring(“MM/dd/yyyy”)


#6

Then just try string s = dt.ToString(“MM/dd/yyyy”)