static DateFormatter Formatter()
        {
            DateFormatter formatter = Cache.Value;

            formatter.Reset();
            return(formatter);
        }
Exemple #2
0
        public long ConvertToTimeMillis(ICharSequence value)
        {
            DateTime?dateTime = DateFormatter.ParseHttpDate(value);

            if (dateTime is null)
            {
                CThrowHelper.ThrowFormatException(value);
            }
            return(dateTime.Value.Ticks / TimeSpan.TicksPerMillisecond);
        }
        public long ConvertToTimeMillis(ICharSequence value)
        {
            DateTime?dateTime = DateFormatter.ParseHttpDate(value);

            if (dateTime == null)
            {
                throw new FormatException($"header can't be parsed into a Date: {value}");
            }
            return(dateTime.Value.Ticks / TimeSpan.TicksPerMillisecond);
        }
Exemple #4
0
 public ICharSequence ConvertTimeMillis(long value) => new StringCharSequence(DateFormatter.Format(new DateTime(value * TimeSpan.TicksPerMillisecond)));