Table of Contents

Class DateTimeExtensions

Namespace
Tripous
Assembly
Tripous.dll

Extensions

public static class DateTimeExtensions
Inheritance
DateTimeExtensions
Inherited Members

Methods

EndOfDay(DateTime)

Returns the end date-time of DT, i.e yyyy-MM-dd 23:59:59.9999999

public static DateTime EndOfDay(this DateTime DT)

Parameters

DT DateTime

Returns

DateTime

GetWeekNumber(DateTime)

Returns the week number the specified date falls in

public static int GetWeekNumber(this DateTime DT)

Parameters

DT DateTime

Returns

int

GetWeekNumber(DateTime, CultureInfo)

Returns the week number the specified date falls in

public static int GetWeekNumber(this DateTime DT, CultureInfo CI)

Parameters

DT DateTime
CI CultureInfo

Returns

int

StartOfDay(DateTime)

Returns the start date-time of DT, i.e. yyyy-MM-dd 00:00:00

public static DateTime StartOfDay(this DateTime DT)

Parameters

DT DateTime

Returns

DateTime

StartOfWeek(DateTime)

Returns the date of the first day of the week of the specified date

public static DateTime StartOfWeek(this DateTime DT)

Parameters

DT DateTime

Returns

DateTime

StartOfWeek(DateTime, CultureInfo)

Returns the date of the first day of the week of the specified date

public static DateTime StartOfWeek(this DateTime DT, CultureInfo CI)

Parameters

DT DateTime
CI CultureInfo

Returns

DateTime

ToFileName(DateTime)

Creates and returns a file name based on DT

The returned string has the format

yyyy-MM-dd HH_mm_ss

public static string ToFileName(this DateTime DT)

Parameters

DT DateTime

Returns

string

ToFileName(DateTime, bool)

Creates and returns a file name based on DT.

The returned string has the format

yyyy-MM-dd HH_mm_ss__fff

public static string ToFileName(this DateTime DT, bool UseMSecs)

Parameters

DT DateTime
UseMSecs bool

Returns

string