Not your Normal Date conversion

well it might be but not one I have done before

Date Scraped is in this format

Jan. 18, 2012

Need to convert it to dd-MM-yyyy to perform matching

@rmorgan

please try this

DateTime.ParseExact("Jan. 18, 2012","MMM. dd, yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MM-yyyy")

cheers

Hi,

How about the following expression?

CDate(yourString).ToString("dd-MM-yyyy")

image

Regards,

Hi @rmorgan

Input= "Jan. 18, 2012"
Output= DateTime.ParseExact(Input.Replace(".","").Replace(",",""),"MMM dd yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MM-yyyy")

Output as below,

Hope it helps!!

@rmorgan

DateTime.ParseExact("Jan. 18, 2012", "MMM. dd, yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MM-yyyy")

1 Like

Hi @rmorgan

Use Below Expression

DateTime.ParseExact(“Jan. 18, 2012”,“MMM. dd, yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd-MM-yyyy”)

Hope it will helps you :slight_smile:
Cheers!!

1 Like

Hi @rmorgan

DateTime.ParseExact(originalDate, "MMM. dd, yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MM-yyyy")

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.