Exemple #1
0
        /// <summary>
        /// Calculate and return timezone.
        /// </summary>
        /// <param name="tz">Input string.</param>
        /// <returns>Parsed timezone.</returns>
        public static string TimeZoneToOffset(string tz)
        {
            if (tz == null)
            {
                return(null);
            }

            tz = tz.ToUpper().Trim();

            if (TimeZones.ContainsKey(tz))
            {
                return(TimeZones[tz].First());
            }

            return(null);
        }