FastDateTimeParser
Provides methods to parse and format date and time strings using a fast custom parser.
Konstruktoren
public FastDateTimeParser(string template)
fastDateTimeParser = FastDateTimeParser(template)
Initializes a new instance of the FastDateTimeParser class with the specified format template.
- template
- The date and time format template.
Eigenschaften
public string Template { get; }
value = fastDateTimeParser.Template
Gets the date and time format template used for parsing and formatting.
Methoden
private static void Append(StringBuilder builder, int value, int size)
FastDateTimeParser.Append(builder, value, size)
Appends the specified integer value to the StringBuilder with a given size.
- builder
- The StringBuilder to append to.
- value
- The integer value to append.
- size
- The number of digits to include.
public DateTime Parse(string input)
result = fastDateTimeParser.Parse(input)
Parses the specified input string into a DateTime based on the predefined template.
- input
- The string input representing the date and time.
Rückgabe: A DateTime object parsed from the input string.
public DateTimeOffset ParseDto(string input)
result = fastDateTimeParser.ParseDto(input)
Parses the specified input string into a DateTimeOffset based on the predefined template, applying the time zone if specified.
- input
- The string input representing the date and time with time zone.
Rückgabe: A DateTimeOffset object parsed from the input string.
public string ToString(DateTime value)
result = fastDateTimeParser.ToString(value)
Converts the specified DateTime to its string representation based on the predefined template.
- value
- The DateTime value to format.
Rückgabe: A string representation of the date and time.
public override string ToString()
result = fastDateTimeParser.ToString()
Returns a string representation of the tuple, with values separated by commas.
Rückgabe: A string representing the tuple's values.