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