C# Class gov.va.medora.utils.DateUtils

Mostrar archivo Open project: OSEHRA/mdo

Public Methods

Method Description
CheckDateRange ( string fromDate, string toDate ) : void
IsoDateStringToDateTime ( string dateString ) : System.DateTime

Changes yyyyMMdd.HHmmss formatted string to date.

pads missing least significant digits (e.g. seconds or milliseconds) with 0s.

is30DayMonth ( int month ) : bool
isLeapYear ( int year ) : bool
isValidDay ( int year, int month, int dy ) : bool
isValidMonth ( int month ) : bool
isWellFormedDatePart ( string dt ) : bool
isWellFormedTimePart ( string dt ) : bool
isWellFormedUtcDateTime ( string dt ) : bool
toVistaTimestampString ( System.DateTime dateTime ) : string
trimSeconds ( string timestamp ) : string
trimTime ( string timestamp ) : string

Removes the time portion (if present) of a date/time string of expected format.

NOTE: this function doesn't check for well-formatted-ness of timestamp argument. If you need to check, use the isWellFormed...() functions

zeroSeconds ( string timestamp ) : string

Private Methods

Method Description
subtractSecond ( string timestamp ) : string

Method Details

CheckDateRange() public static method

public static CheckDateRange ( string fromDate, string toDate ) : void
fromDate string
toDate string
return void

IsoDateStringToDateTime() public static method

Changes yyyyMMdd.HHmmss formatted string to date.
pads missing least significant digits (e.g. seconds or milliseconds) with 0s.
public static IsoDateStringToDateTime ( string dateString ) : System.DateTime
dateString string
return System.DateTime

is30DayMonth() public static method

public static is30DayMonth ( int month ) : bool
month int
return bool

isLeapYear() public static method

public static isLeapYear ( int year ) : bool
year int
return bool

isValidDay() public static method

public static isValidDay ( int year, int month, int dy ) : bool
year int
month int
dy int
return bool

isValidMonth() public static method

public static isValidMonth ( int month ) : bool
month int
return bool

isWellFormedDatePart() public static method

public static isWellFormedDatePart ( string dt ) : bool
dt string
return bool

isWellFormedTimePart() public static method

public static isWellFormedTimePart ( string dt ) : bool
dt string
return bool

isWellFormedUtcDateTime() public static method

public static isWellFormedUtcDateTime ( string dt ) : bool
dt string
return bool

toVistaTimestampString() public static method

public static toVistaTimestampString ( System.DateTime dateTime ) : string
dateTime System.DateTime
return string

trimSeconds() public static method

public static trimSeconds ( string timestamp ) : string
timestamp string
return string

trimTime() public static method

Removes the time portion (if present) of a date/time string of expected format.
NOTE: this function doesn't check for well-formatted-ness of timestamp argument. If you need to check, use the isWellFormed...() functions
public static trimTime ( string timestamp ) : string
timestamp string yyyyMMdd.HHmmss or yyyyMMdd
return string

zeroSeconds() public static method

public static zeroSeconds ( string timestamp ) : string
timestamp string
return string