Class ConvertDateTimeToFileNamePostfix
- Namespace
- SunamoDateTime.Converters
- Assembly
- SunamoDateTime.dll
Converts DateTime to filename with postfix. EN: Formats DateTime as filename with custom postfix appended. CZ: Formátuje DateTime jako název souboru s připojeným vlastním postfixem.
public class ConvertDateTimeToFileNamePostfix
- Inheritance
-
ConvertDateTimeToFileNamePostfix
- Inherited Members
- Extension Methods
Methods
FromConvention(string, bool)
Parses DateTime from filename, ignoring the postfix. EN: Use DTHelper.FileNameToDateTimePostfix if you need to extract the postfix too. CZ: Použijte DTHelper.FileNameToDateTimePostfix pokud potřebujete také extrahovat postfix.
public static DateTime? FromConvention(string fileNameWithoutExtension, bool includeTime)
Parameters
fileNameWithoutExtensionstringFilename without extension to parse
includeTimeboolTrue if filename includes time component
Returns
- DateTime?
Parsed DateTime or null if parsing fails
ToConvention(string, DateTime, bool)
Converts DateTime to filename format with postfix. EN: Creates filename in format: [DateTime][postfix]. If postfix contains delimiter (), it won't be replaced. CZ: Vytvoří název souboru ve formátu: [DateTime][postfix]. Pokud postfix obsahuje delimiter (), nebude nahrazen.
public static string ToConvention(string postfix, DateTime dateTime, bool includeTime)
Parameters
postfixstringThe postfix to append after DateTime
dateTimeDateTimeThe DateTime to convert
includeTimeboolTrue to include time component in filename
Returns
- string
Formatted filename string