Sitecore 5.1.1 API

DateUtil.IsoDateToNormal Method 

Converts an ISO formatted date/time string to a string with the format "yyyy-mm-dd hh:mm:ss".

[Visual Basic]
Public Shared Function IsoDateToNormal( _
   ByVal sDatetime As String _
) As String
[C#]
public static string IsoDateToNormal(
   string sDatetime
);

Parameters

sDatetime
An ISO formatted date/time string.

Return Value

The formatted date/time. If the ISO formatted date/time is not valid, blank is returned.

Remarks

The date/time string is formatted as "yyyyMMddTHHmmss".

Example

The following example formats an ISO formatted date/time string to a "yyyy-mm-dd hh:mm:ss" string.

  string isoNow = DateUtil.DateTimeToIsoDate(DateTime.Now);
  string now = DateUtil.IsoDateToNormal(isoNow);

See Also

DateUtil Class | Sitecore Namespace