Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetRealFormat()

static string System.DateTimeFormat.GetRealFormat ( ReadOnlySpan< char > format,
DateTimeFormatInfo dtfi )
inlinestaticpackage

Definition at line 512 of file DateTimeFormat.cs.

513 {
514 switch (format[0])
515 {
516 case 'd':
517 return dtfi.ShortDatePattern;
518 case 'D':
519 return dtfi.LongDatePattern;
520 case 'f':
521 return dtfi.LongDatePattern + " " + dtfi.ShortTimePattern;
522 case 'F':
523 return dtfi.FullDateTimePattern;
524 case 'g':
525 return dtfi.GeneralShortTimePattern;
526 case 'G':
527 return dtfi.GeneralLongTimePattern;
528 case 'M':
529 case 'm':
530 return dtfi.MonthDayPattern;
531 case 'O':
532 case 'o':
533 return "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK";
534 case 'R':
535 case 'r':
536 return dtfi.RFC1123Pattern;
537 case 's':
538 return dtfi.SortableDateTimePattern;
539 case 't':
540 return dtfi.ShortTimePattern;
541 case 'T':
542 return dtfi.LongTimePattern;
543 case 'u':
544 return dtfi.UniversalSortableDateTimePattern;
545 case 'U':
546 return dtfi.FullDateTimePattern;
547 case 'Y':
548 case 'y':
549 return dtfi.YearMonthPattern;
550 default:
551 throw new FormatException(SR.Format_InvalidString);
552 }
553 }

References System.format, and System.SR.Format_InvalidString.

Referenced by System.DateTimeFormat.ExpandPredefinedFormat(), and System.DateTimeParse.ExpandPredefinedFormat().