BlogEngine.Core.SyndicationGenerator.FormatW3COffset C# (CSharp) Method

FormatW3COffset() private static method

Converts the value of the specified TimeSpan to its equivalent string representation.
private static FormatW3COffset ( System.TimeSpan offset, string separator ) : string
offset System.TimeSpan /// The to convert. ///
separator string /// Separator used to deliminate hours and minutes. ///
return string
        private static string FormatW3COffset(TimeSpan offset, string separator)
        {
            var formattedOffset = String.Empty;

            if (offset >= TimeSpan.Zero)
            {
                formattedOffset = "+";
            }

            return String.Concat(
                formattedOffset,
                offset.Hours.ToString("00", CultureInfo.InvariantCulture),
                separator,
                offset.Minutes.ToString("00", CultureInfo.InvariantCulture));
        }