Documentation > Services API > ServicesUtil > ReformatDate(String,String)

ReformatDate

Parses a date string into a DateTime object and changes the format to the default "MMMM d, yyyy" or to a custom format.

public System.String ReformatDate(String,String)


Returns

DateTime.ToString(dateFormat)

Parameters

NameDescriptionType
dateString Date string to be parsed and reformatted. System.String
dateFormat Date format to be applied to the DateTime object. System.String

Code Example

C#

Sample:

            string dateString = "12 12, 2012";
            Out.WriteLine(ServicesUtil.ReformatDate(dateString));
            Out.WriteLine(ServicesUtil.ReformatDate(dateString, "dddd MMMM d, yyyy"));
            

Connect with Crownpeak