8 internal static readonly
string[]
s_validDateTimeFormats =
new string[4] {
"ddd, dd MMM yyyy HH:mm:ss",
"dd MMM yyyy HH:mm:ss",
"ddd, dd MMM yyyy HH:mm",
"dd MMM yyyy HH:mm" };
105 for (
int i = 0; i <
value.Length; i++)
107 if (!
char.IsLetter(
value, i))
121 if (
string.IsNullOrEmpty(data))
125 int num = data.IndexOf(
':');
135 string s = data.AsSpan(0,
num2).Trim().ToString();
140 string text = data.AsSpan(
num2).Trim().ToString();
146 if (
string.IsNullOrEmpty(
text))
194 if (
span.Ticks == 0
L)
200 string text = ((span.Ticks > 0) ?
"+" :
"-");
static CultureInfo InvariantCulture
static double Abs(double value)
static double Floor(double d)
void ValidateAndGetTimeZoneOffsetValues(string offset, out bool positive, out int hours, out int minutes)
override string ToString()
SmtpDateTime(string value)
static readonly char[] s_allowedWhiteSpaceChars
readonly bool _unknownTimeZone
static Dictionary< string, TimeSpan > InitializeShortHandLookups()
void ValidateTimeZoneShortHandValue(string value)
readonly TimeSpan _timeZone
bool TryParseTimeZoneString(string timeZoneString, out TimeSpan timeZone)
string TimeSpanToOffset(TimeSpan span)
DateTime ParseValue(string data, out string timeZone)
TimeSpan ValidateAndGetSanitizedTimeSpan(TimeSpan span)
static readonly string[] s_validDateTimeFormats
SmtpDateTime(DateTime value)
static readonly Dictionary< string, TimeSpan > s_timeZoneOffsetLookup
string FormatDate(DateTime value)
static string Format(string resourceFormat, object p1)
static string MailDateInvalidFormat
static string MailHeaderFieldInvalidCharacter
static TimeZoneInfo Local
static DateTime SpecifyKind(DateTime value, DateTimeKind kind)
static bool TryParseExact([NotNullWhen(true)] string? s, [NotNullWhen(true)] string? format, IFormatProvider? provider, DateTimeStyles style, out DateTime result)
static readonly TimeSpan Zero