src/umbraco.presentation.xslt.Exslt/ExsltDatesAndTimes.cs
/// <summary>
/// Implements the following function
///		number date:seconds(string)
/// </summary>
/// <returns>The amount of seconds between the specified date and the 
/// epoch (1970-01-01T00:00:00Z)</returns>
Implements the following function
number date:seconds(string)
Implements the following function number date : seconds ( string )
public static  double  seconds(string datetime){
			try{
				DateTime epoch  = new DateTime(1970, 1, 1, 0,0,0,0, CultureInfo.CurrentCulture.Calendar);
				DateTime date   = DateTime.Parse(datetime);; 
				return date.Subtract(epoch).TotalSeconds; 
			}catch(FormatException){ ; } 
			try{
				TimeSpan duration = XmlConvert.ToTimeSpan(datetime); 
				return duration.TotalSeconds;
			}catch(FormatException){
				return System.Double.NaN;
			}
		}
public static double seconds ( string datetime ) { try { DateTime epoch = new DateTime ( 1970 , 1 , 1 , 0 , 0 , 0 , 0 , CultureInfo . CurrentCulture . Calendar ) ; DateTime date = DateTime . Parse ( datetime ) ; ; return date . Subtract ( epoch ) . TotalSeconds ; } catch ( FormatException ) { ; } try { TimeSpan duration = XmlConvert . ToTimeSpan ( datetime ) ; return duration . TotalSeconds ; } catch ( FormatException ) { return System . Double . NaN ; } }
Implements the following function
number date:seconds(string)
Implements the following function number date : seconds ( string )
//might be a duration
The amount of seconds between the specified date and the
epoch (1970-01-01T00:00:00Z)
The amount of seconds between the specified date and the epoch ( 1970 - 01 - 01T00 : 00 : 00Z )
datetime
string