Class SepaDateUtil
Utility methods for working with SEPA dates and schedules.
Inherited Members
Namespace: Subsembly.Sepa
Assembly: Subsembly.Sepa.dll
Syntax
public static class SepaDateUtil
Properties
CetNow
Returns the current Central European Date and Time, regardless of the local timezone of this computer.
Declaration
public static DateTime CetNow { get; }
Property Value
Type | Description |
---|---|
DateTime |
Remarks
If the local timezone of this computer already is the CET time zone, then the
DateTime.Kind
property will be DateTimeKind.Local
. If the local
timezone of this computer is any other time zone, then the DateTime.Kind
property will be DateTimeKind.Unspecified
.
CetToday
Returns the current Central European Date, regardless of the local timezone of this computer.
Declaration
public static DateTime CetToday { get; }
Property Value
Type | Description |
---|---|
DateTime |
Remarks
If the local timezone of this computer is the Central European Time Zone, then the
DateTime.Kind
property will be DateTimeKind.Local
. If the local
timezone of this computer is any other time zone, then the DateTime.Kind
property will be DateTimeKind.Unspecified
.
IsCentralEuropeanTime
Indicates whether the local time zone of this computer equals the Central European Time Zone.
Declaration
public static bool IsCentralEuropeanTime { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
ConvertToCet(DateTime)
Converts a given date and time of any kind to the same point in time at the Central European Time Zone.
Declaration
public static DateTime ConvertToCet(DateTime tDateTime)
Parameters
Type | Name | Description |
---|---|---|
DateTime | tDateTime | The date and time to be converted. |
Returns
Type | Description |
---|---|
DateTime | With the exception of |
Remarks
If tDateTime
is DateTime.MinValue
or
DateTime.MaxValue
, then this method does nothing and just returns
the given parameter. The DateTime.Kind
is ignored in this case.
If the DateTime.Kind
of the parameter is DateTimeKind.Unspecified
,
then it is assumed to already be a CET date time specification and no conversion
is done.
If the DateTime.Kind
of the parameter is DateTimeKind.Local
, and the
computers local time zone is not the Central European Time Zone, then it is
converted from the computers local time zone to the CET time zone.
If the DateTime.Kind
of the parameter is DateTimeKind.Utc
,
then it is converted from UTC to the CET time zone.
ConvertToLocal(DateTime)
Converts a given date and time of any kind to the same point in time at the compüuters local time zone.
Declaration
public static DateTime ConvertToLocal(DateTime tDateTime)
Parameters
Type | Name | Description |
---|---|---|
DateTime | tDateTime | The date and time to be converted. |
Returns
Type | Description |
---|---|
DateTime | With the exception of |
Remarks
If tDateTime
is DateTime.MinValue
or
DateTime.MaxValue
, then this method does nothing and just returns
the given parameter. The DateTime.Kind
is ignored in this case.
If the DateTime.Kind
of the parameter is DateTimeKind.Unspecified
,
then it is assumed to be a CET date time specification. If the computers local
time zone is CET, then the DateTime.Kind
will simply be set to
DateTimeKind.Local
. Otherwise, the date/time is converted from CET
to the computers local time.
If the DateTime.Kind
of the parameter is DateTimeKind.Local
,
then this method does nothing and just returns the given parameter.
If the DateTime.Kind
of the parameter is DateTimeKind.Utc
,
then the parameter is converted from UTC to the computers local time.
ConvertToUtc(DateTime)
Converts a given date and time of any kind to the same point in time at the UTC Time Zone.
Declaration
public static DateTime ConvertToUtc(DateTime tDateTime)
Parameters
Type | Name | Description |
---|---|---|
DateTime | tDateTime | The date and time to be converted. |
Returns
Type | Description |
---|---|
DateTime | With the exception of |
Remarks
If tDateTime
is DateTime.MinValue
or
DateTime.MaxValue
, then this method does nothing and just returns
the given parameter. The DateTime.Kind
is ignored in this case.
If the DateTime.Kind
of the parameter is DateTimeKind.Unspecified
,
then it is assumed to be a CET date time specification and is converted from CET
to UTC time.
If the DateTime.Kind
of the parameter is DateTimeKind.Local
,
then it is converted from the computers local time zone to the UTC time zone.
If the DateTime.Kind
of the parameter is DateTimeKind.Utc
,
then the parameter is returned as is.
GetNextBankBusinessDay()
Determine the next bank business day (never today).
Declaration
public static DateTime GetNextBankBusinessDay()
Returns
Type | Description |
---|---|
DateTime | The returned date is at least tomorrows date, but may be further in the future because of weekends and public holidays. |
GetNextBankBusinessDay(DateTime)
Returns the bank business day following the given date.
Declaration
public static DateTime GetNextBankBusinessDay(DateTime tDate)
Parameters
Type | Name | Description |
---|---|---|
DateTime | tDate | The date for which to return the next bank business date. The time of day of this value will be maintained in the return value. |
Returns
Type | Description |
---|---|
DateTime | The returned date is at least one day after |
GetPreviousBankBusinessDay(DateTime)
Returns the bank business day preceeding the given date.
Declaration
public static DateTime GetPreviousBankBusinessDay(DateTime tDate)
Parameters
Type | Name | Description |
---|---|---|
DateTime | tDate | The date for which to return the previous bank business date. The time of day of this value will be maintained in the return value. |
Returns
Type | Description |
---|---|
DateTime | The date of the previous bank business day. If the parameter
|
IsBankBusinessDay(DateTime)
Check whether the given date is a bank business day.
Declaration
public static bool IsBankBusinessDay(DateTime tDate)
Parameters
Type | Name | Description |
---|---|---|
DateTime | tDate |
Returns
Type | Description |
---|---|
bool |