Table of Contents

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

fileNameWithoutExtension string

Filename without extension to parse

includeTime bool

True 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

postfix string

The postfix to append after DateTime

dateTime DateTime

The DateTime to convert

includeTime bool

True to include time component in filename

Returns

string

Formatted filename string