Class SepaDateUtil
Utility methods for working with SEPA dates and schedules.
public static class SepaDateUtil
- Inheritance
-
SepaDateUtil
- Inherited Members
Properties
CetNow
Returns the current Central European Date and Time, regardless of the local timezone of this computer.
public static DateTime CetNow { get; }
Property Value
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.
public static DateTime CetToday { get; }
Property Value
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.
public static bool IsCentralEuropeanTime { get; }
Property Value
Methods
ConvertToCet(DateTime)
Converts a given date and time of any kind to the same point in time at the Central European Time Zone.
public static DateTime ConvertToCet(DateTime tDateTime)
Parameters
tDateTimeDateTimeThe date and time to be converted.
Returns
- DateTime
With the exception of
DateTime.MinValueandDateTime.MaxValue, if the computers local time zone is the Central European Time Zone, then the returnedDateTimeKindwill always be set toLocal. If the computers local time zone is different, then the returnedDateTimeKindisUnspecified.
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.
public static DateTime ConvertToLocal(DateTime tDateTime)
Parameters
tDateTimeDateTimeThe date and time to be converted.
Returns
- DateTime
With the exception of
DateTime.MinValueandDateTime.MaxValue, theDateTime.Kindof the returnedDateTimeis alwaysDateTimeKind.Local.
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.
public static DateTime ConvertToUtc(DateTime tDateTime)
Parameters
tDateTimeDateTimeThe date and time to be converted.
Returns
- DateTime
With the exception of
DateTime.MinValueandDateTime.MaxValue, theDateTime.Kindof the returnedDateTimeis alwaysDateTimeKind.Utc.
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).
public static DateTime GetNextBankBusinessDay()
Returns
- 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.
public static DateTime GetNextBankBusinessDay(DateTime tDate)
Parameters
tDateDateTimeThe 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
- DateTime
The returned date is at least one day after
tDate, but may be further in the future because of weekends and public holidays. If the parametertDatewasDateTime.MinValue, thenDateTime.MinValueis returned.
GetPreviousBankBusinessDay(DateTime)
Returns the bank business day preceeding the given date.
public static DateTime GetPreviousBankBusinessDay(DateTime tDate)
Parameters
tDateDateTimeThe 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
- DateTime
The date of the previous bank business day. If the parameter
tDatewasDateTime.MinValue, thenDateTime.MinValueis returned.
IsBankBusinessDay(DateTime)
Check whether the given date is a bank business day.
public static bool IsBankBusinessDay(DateTime tDate)
Parameters
tDateDateTime