public static ToRelativeDateString ( this dateTime, int maxDays = null ) : string | ||
dateTime | this | the datetime to convert to relative time. |
maxDays | int | maximum number of days before formatting in FB date-time format (ex. November 5, 2011 at 1:57pm) |
return | string |
public static string ToRelativeDateString( this DateTime? dateTime, int? maxDays = null )
{
if ( dateTime.HasValue )
{
return dateTime.Value.ToRelativeDateString( maxDays );
}
else
{
return string.Empty;
}
}