Table of Contents

Class DTHelperUs

Namespace
SunamoDateTime.DT
Assembly
SunamoDateTime.dll

Underscore

public class DTHelperUs
Inheritance
DTHelperUs
Inherited Members
Extension Methods

Methods

DateTimeToFileName(DateTime)

yyyy_mm_dd

public static string DateTimeToFileName(DateTime dt)

Parameters

dt DateTime

Returns

string

DateTimeToFileName(DateTime, bool)

yyyy_mm_dd With A2 append hh_mm

public static string DateTimeToFileName(DateTime dt, bool time)

Parameters

dt DateTime
time bool

Returns

string

FileNameToDateTime(string)

1989_06_21_11_22 Return null if wont have right format

public static DateTime? FileNameToDateTime(string filenameWithoutExtension)

Parameters

filenameWithoutExtension string

Returns

DateTime?

FileNameToDateTimePostfix(string, bool, out string)

Return null if wont have right format If A2, A1 must have format ???????????? if !A2, A1 must have format ???????? In any case what is after A2 is not important

public static DateTime? FileNameToDateTimePostfix(string filenameWithoutExtension, bool time, out string postfix)

Parameters

filenameWithoutExtension string
time bool
postfix string

Returns

DateTime?

FileNameToDateTimePrefix(string, bool, out string)

Parses a DateTime from a filename with date parts after a prefix (e.g. "prefix_1989_06_21_11_22"). Returns null if the format is invalid.

public static DateTime? FileNameToDateTimePrefix(string filenameWithoutExtension, bool time, out string prefix)

Parameters

filenameWithoutExtension string

The filename without extension

time bool

Whether the filename includes time parts (hour, minute)

prefix string

Output: the prefix text before the date parts

Returns

DateTime?

FileNameToDateWithSeriePostfix(string, out int?, out string)

Return null if wont have right format If A2, A1 must have format ????????S?*

public static DateTime? FileNameToDateWithSeriePostfix(string filenameWithoutExtension, out int? serie, out string postfix)

Parameters

filenameWithoutExtension string
serie int?
postfix string

Returns

DateTime?