static DateFormatter Formatter() { DateFormatter formatter = Cache.Value; formatter.Reset(); return(formatter); }
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); }
public ICharSequence ConvertTimeMillis(long value) => new StringCharSequence(DateFormatter.Format(new DateTime(value * TimeSpan.TicksPerMillisecond)));