111 references to DateTimeFormat
System.Private.CoreLib (111)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Date.cs (10)
37return DateTimeFormat.TryFormatInvariantG(value.DateTime, value.Offset, destination, out bytesWritten); 43return DateTimeFormat.TryFormatR(value.UtcDateTime, NullOffset, destination, out bytesWritten); 46return DateTimeFormat.TryFormatO(value.DateTime, value.Offset, destination, out bytesWritten); 52return DateTimeFormat.TryFormatInvariantG(value.DateTime, NullOffset, destination, out bytesWritten); 86return DateTimeFormat.TryFormatR(value, NullOffset, destination, out bytesWritten); 89return DateTimeFormat.TryFormatO(value, NullOffset, destination, out bytesWritten); 95return DateTimeFormat.TryFormatInvariantG(value, NullOffset, destination, out bytesWritten); 106if (DateTimeFormat.TryFormatR(value, NullOffset, destination, out bytesWritten)) 108Debug.Assert(bytesWritten == DateTimeFormat.FormatRLength); 116private static TimeSpan NullOffset => new TimeSpan(DateTimeFormat.NullOffset);
src\libraries\System.Private.CoreLib\src\System\DateOnly.cs (16)
501provider = DateTimeFormat.InvariantFormatInfo; 506provider = DateTimeFormat.InvariantFormatInfo; 578dtfiToUse = DateTimeFormat.InvariantFormatInfo; 583dtfiToUse = DateTimeFormat.InvariantFormatInfo; 721public override string ToString() => DateTimeFormat.Format(GetEquivalentDateTime(), "d", null); 735public string ToString(IFormatProvider? provider) => DateTimeFormat.Format(GetEquivalentDateTime(), "d", provider); 756DateTimeFormat.TryFormatDateOnlyO(value, destination, out int charsWritten); 762DateTimeFormat.TryFormatDateOnlyR(value, destination, out int charsWritten); 766'm' or 'd' or 'y' => DateTimeFormat.Format(GetEquivalentDateTime(), format, provider), 772DateTimeFormat.IsValidCustomDateOnlyFormat(format.AsSpan(), throwOnError: true); 773return DateTimeFormat.Format(GetEquivalentDateTime(), format, provider); 804return DateTimeFormat.TryFormatDateOnlyO(this, destination, out charsWritten); 807return DateTimeFormat.TryFormatDateOnlyR(this, destination, out charsWritten); 812return DateTimeFormat.TryFormat(GetEquivalentDateTime(), destination, out charsWritten, format, provider); 820if (!DateTimeFormat.IsValidCustomDateOnlyFormat(format, throwOnError: false)) 825return DateTimeFormat.TryFormat(GetEquivalentDateTime(), destination, out charsWritten, format, provider);
src\libraries\System.Private.CoreLib\src\System\DateTime.cs (12)
1735return DateTimeFormat.Format(this, "D", null); 1740return DateTimeFormat.Format(this, "T", null); 1745return DateTimeFormat.Format(this, "d", null); 1750return DateTimeFormat.Format(this, "t", null); 1755return DateTimeFormat.Format(this, null, null); 1760return DateTimeFormat.Format(this, format, null); 1765return DateTimeFormat.Format(this, null, provider); 1770return DateTimeFormat.Format(this, format, provider); 1774DateTimeFormat.TryFormat(this, destination, out charsWritten, format, provider); 1778DateTimeFormat.TryFormat(this, utf8Destination, out bytesWritten, format, provider); 1934return DateTimeFormat.GetAllDateTimes(this, DateTimeFormatInfo.GetInstance(provider)); 1950return DateTimeFormat.GetAllDateTimes(this, format, DateTimeFormatInfo.GetInstance(provider));
src\libraries\System.Private.CoreLib\src\System\DateTimeOffset.cs (6)
793DateTimeFormat.Format(ClockDateTime, null, null, Offset); 796DateTimeFormat.Format(ClockDateTime, format, null, Offset); 799DateTimeFormat.Format(ClockDateTime, null, formatProvider, Offset); 802DateTimeFormat.Format(ClockDateTime, format, formatProvider, Offset); 805DateTimeFormat.TryFormat(ClockDateTime, destination, out charsWritten, format, formatProvider, Offset); 809DateTimeFormat.TryFormat(ClockDateTime, utf8Destination, out bytesWritten, format, formatProvider, Offset);
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (2)
285public static DateTimeFormatInfo InvariantInfo => DateTimeFormat.InvariantFormatInfo; 1293foreach (char standardFormat in DateTimeFormat.AllStandardFormats)
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (7)
3166Debug.Assert(maxDigitLen <= DateTimeFormat.MaxSecondsFractionDigits); 3351if (ReferenceEquals(dtfi, DateTimeFormat.InvariantFormatInfo)) 3452if (ReferenceEquals(dtfi, DateTimeFormat.InvariantFormatInfo)) 3553if (ReferenceEquals(dtfi, DateTimeFormat.InvariantFormatInfo)) 3620if (ReferenceEquals(dtfi, DateTimeFormat.InvariantFormatInfo)) 4001return DateTimeFormat.ExpandStandardFormatToCustomPattern(format, dtfi); 4221if (tokenLen <= DateTimeFormat.MaxSecondsFractionDigits)
src\libraries\System.Private.CoreLib\src\System\Globalization\HebrewNumber.cs (6)
119DateTimeFormat.AppendChar(ref outputBuffer, '\x05ea'); 125DateTimeFormat.AppendChar(ref outputBuffer, (char)('\x05e6' + remains)); 194DateTimeFormat.AppendChar(ref outputBuffer, cTens); 199DateTimeFormat.AppendChar(ref outputBuffer, cUnits); 217DateTimeFormat.AppendChar(ref outputBuffer, (char)value.Value); 222DateTimeFormat.AppendChar(ref outputBuffer, '\'');
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (26)
153fractionDigits = DateTimeFormat.MaxSecondsFractionDigits; 160fractionDigits = DateTimeFormat.MaxSecondsFractionDigits; 170fractionDigits = DateTimeFormat.MaxSecondsFractionDigits - FormattingHelpers.CountDecimalTrailingZeros(fraction, out fraction); 325tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); 330DateTimeFormat.FormatDigits(ref result, hours, tokenLen); 333tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); 338DateTimeFormat.FormatDigits(ref result, minutes, tokenLen); 341tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); 346DateTimeFormat.FormatDigits(ref result, seconds, tokenLen); 352tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); 353if (tokenLen > DateTimeFormat.MaxSecondsFractionDigits) 359tmp /= TimeSpanParse.Pow10UpToMaxFractionDigits(DateTimeFormat.MaxSecondsFractionDigits - tokenLen); 360DateTimeFormat.FormatFraction(ref result, tmp, DateTimeFormat.fixedNumberFormats[tokenLen - 1]); 366tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); 367if (tokenLen > DateTimeFormat.MaxSecondsFractionDigits) 373tmp /= TimeSpanParse.Pow10UpToMaxFractionDigits(DateTimeFormat.MaxSecondsFractionDigits - tokenLen); 389DateTimeFormat.FormatFraction(ref result, tmp, DateTimeFormat.fixedNumberFormats[effectiveDigits - 1]); 397tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); 403DateTimeFormat.FormatDigits(ref result, day, tokenLen); 407tokenLen = DateTimeFormat.ParseQuoteString(format, i, ref result); 413nextChar = DateTimeFormat.ParseNextChar(format, i); 435nextChar = DateTimeFormat.ParseNextChar(format, i); 491x.ff = DateTimeFormat.MaxSecondsFractionDigits; 612ff = DateTimeFormat.MaxSecondsFractionDigits;
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanParse.cs (10)
1276tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); 1285tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); 1294tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); 1303tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); 1304if (tokenLen > DateTimeFormat.MaxSecondsFractionDigits || seenFF || !ParseExactDigits(ref tokenizer, tokenLen, tokenLen, out leadingZeroes, out ff)) 1312tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); 1313if (tokenLen > DateTimeFormat.MaxSecondsFractionDigits || seenFF) 1322tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); 1350nextFormatChar = DateTimeFormat.ParseNextChar(format, i); 1370nextFormatChar = DateTimeFormat.ParseNextChar(format, i);
src\libraries\System.Private.CoreLib\src\System\TimeOnly.cs (16)
672provider = DateTimeFormat.InvariantFormatInfo; 677provider = DateTimeFormat.InvariantFormatInfo; 748dtfiToUse = DateTimeFormat.InvariantFormatInfo; 753dtfiToUse = DateTimeFormat.InvariantFormatInfo; 891public override string ToString() => DateTimeFormat.Format(ToDateTime(), "t", null); 906public string ToString(IFormatProvider? provider) => DateTimeFormat.Format(ToDateTime(), "t", provider); 928DateTimeFormat.TryFormatTimeOnlyO(value, destination, out int charsWritten); 934DateTimeFormat.TryFormatTimeOnlyR(value, destination, out int charsWritten); 938't' => DateTimeFormat.Format(ToDateTime(), format, provider), 944DateTimeFormat.IsValidCustomTimeOnlyFormat(format.AsSpan(), throwOnError: true); 945return DateTimeFormat.Format(ToDateTime(), format, provider); 976return DateTimeFormat.TryFormatTimeOnlyO(this, destination, out written); 979return DateTimeFormat.TryFormatTimeOnlyR(this, destination, out written); 982return DateTimeFormat.TryFormat(ToDateTime(), destination, out written, format, provider); 990if (!DateTimeFormat.IsValidCustomTimeOnlyFormat(format, throwOnError: false)) 995return DateTimeFormat.TryFormat(ToDateTime(), destination, out written, format, provider);