Beispiel #1
0
 public static PosixTz TryParse(string str)
 {
     try {
         var reader = new PosixTzReader(str);
         return(reader.ReadExpandedTimeZone());
     } catch {
         return(null);
     }
 }
            public static DstRule Parse(string str)
            {
                var reader = new PosixTzReader(str);

                reader.SkipWhiteSpaces();
                DstRule rule = null;

                if (!reader.ReadRule(ref rule))
                {
                    reader.RaiseParseError();
                }
                reader.SkipWhiteSpaces();
                if (!reader.AtEnd())
                {
                    reader.RaiseParseError();
                }
                return(rule);
            }
            public static TimeUnit Parse(string str)
            {
                var reader = new PosixTzReader(str);

                reader.SkipWhiteSpaces();
                TimeUnit time = reader.ReadTime();

                if (time == null)
                {
                    reader.RaiseParseError();
                }
                reader.SkipWhiteSpaces();
                if (!reader.AtEnd())
                {
                    reader.RaiseParseError();
                }
                return(time);
            }
Beispiel #4
0
        public static PosixTz Parse(string str)
        {
            var reader = new PosixTzReader(str);

            return(reader.ReadExpandedTimeZone());
        }