src/umbraco.presentation.xslt.Exslt/ExsltDatesAndTimes.cs
/// <summary>
/// Implements the following function
///   string date:parse-date(string, string)
/// </summary>
/// <param name="date">The date to parse</param>
/// <param name="format">One of the format strings understood by the 
/// DateTime.ToString(string) method.</param>
/// <returns>The parsed date</returns>
Implements the following function
string date:parse-date(string, string)
Implements the following function string date : parse - date ( string string )
public static string parsedate(string d, string format){
			try{
				DateTime date = DateTime.ParseExact(d, format, CultureInfo.CurrentCulture); 
				return XmlConvert.ToString(date, XmlDateTimeSerializationMode.Unspecified);
			}catch(FormatException){
				return ""; 
			}
		}
public static string parsedate ( string d , string format ) { try { DateTime date = DateTime . ParseExact ( d , format , CultureInfo . CurrentCulture ) ; return XmlConvert . ToString ( date , XmlDateTimeSerializationMode . Unspecified ) ; } catch ( FormatException ) { return " " ; } }
Implements the following function
string date:parse-date(string, string)
Implements the following function string date : parse - date ( string string )
The parsed date
The parsed date
d
string
format
string
One of the format strings understood by the
DateTime.ToString(string) method.
One of the format strings understood by the DateTime . ToString ( string ) method .
date
The date to parse
The date to parse