Date time format changer

Hi,
I have a format of date is 12/04/2018 , i got and i need to paste this into website with the 12 apr 2018 how can i convert ?

Regards
Spark

Hi @Spark_robot,

Try below code to convert the date format
Convert.ToDateTime("12/04/2018").ToString("dd MMM yyyy")

1 Like

Hi @Spark_robot,

use below code
DateTime.ParseExtract("12/04/2018","MM/dd/yyyy", System.Globalization.CultrueInfo.InvariantCulture).ToString("dd MMM yyyy")

  • 12/04/2018 is your input date stirng
  • MM/dd/yyyy is your input date format
  • dd MMM yyyy is your expected date format

Regards,
Arivu

1 Like

As @arivu96 's solution, my syntax is slightly different but achieves the same thing as the other one didn’t work for me.

(Date.ParseExact(yourDate,“dd/MM/yyyy”,system.Globalization.DateTimeFormatInfo.InvariantInfo)).tostring(“dd MMM yyyy”)