Show / Hide Table of Contents

Class Date

Date specifications

Inheritance
object
Date
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: PayrollEngine.Client.Scripting
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
public static class Date

Fields

View Source

DaysInWeek

Number of days in a week

Declaration
public static readonly int DaysInWeek
Field Value
Type Description
int
View Source

FirstDayOfMonth

First day in month

Declaration
public static readonly int FirstDayOfMonth
Field Value
Type Description
int
View Source

FirstMonthOfCalendarYear

First month in year

Declaration
public static readonly int FirstMonthOfCalendarYear
Field Value
Type Description
int
View Source

LastMonthOfCalendarYear

Last month in year

Declaration
public static readonly int LastMonthOfCalendarYear
Field Value
Type Description
int
View Source

MonthsInYear

Number of months in a year

Declaration
public static readonly int MonthsInYear
Field Value
Type Description
int

Properties

View Source

MaxValue

Represents the largest possible value of a time instant

Declaration
public static DateTime MaxValue { get; }
Property Value
Type Description
DateTime
View Source

MinValue

Represents the smallest possible value of a time instant

Declaration
public static DateTime MinValue { get; }
Property Value
Type Description
DateTime
View Source

Now

Gets a time instant that is set to the current date and time

Declaration
public static DateTime Now { get; }
Property Value
Type Description
DateTime
View Source

Today

Gets a time instant that is set to the current day

Declaration
public static DateTime Today { get; }
Property Value
Type Description
DateTime
View Source

Tomorrow

Gets a time instant that is set to the next day

Declaration
public static DateTime Tomorrow { get; }
Property Value
Type Description
DateTime
Remarks

Computed property (not static readonly) so the value updates with Today.

View Source

Yesterday

Gets a time instant that is set to the previous day

Declaration
public static DateTime Yesterday { get; }
Property Value
Type Description
DateTime
Remarks

Computed property (not static readonly) so the value updates with Today.

Methods

View Source

DayEnd(int, int, int)

Get the day end date and time in UTC

Declaration
public static DateTime DayEnd(int year, int month, int day)
Parameters
Type Name Description
int year
int month
int day
Returns
Type Description
DateTime
View Source

DayStart(int, int, int)

Get the day start date and time in UTC

Declaration
public static DateTime DayStart(int year, int month, int day)
Parameters
Type Name Description
int year
int month
int day
Returns
Type Description
DateTime
View Source

Max(DateTime, DateTime)

Get the maximum date

Declaration
public static DateTime Max(DateTime left, DateTime right)
Parameters
Type Name Description
DateTime left
DateTime right
Returns
Type Description
DateTime
View Source

Max(TimeSpan, TimeSpan)

Get the maximum timespan

Declaration
public static TimeSpan Max(TimeSpan left, TimeSpan right)
Parameters
Type Name Description
TimeSpan left
TimeSpan right
Returns
Type Description
TimeSpan
View Source

Min(DateTime, DateTime)

Get the minimum date

Declaration
public static DateTime Min(DateTime left, DateTime right)
Parameters
Type Name Description
DateTime left
DateTime right
Returns
Type Description
DateTime
View Source

Min(TimeSpan, TimeSpan)

Get the minimum timespan

Declaration
public static TimeSpan Min(TimeSpan left, TimeSpan right)
Parameters
Type Name Description
TimeSpan left
TimeSpan right
Returns
Type Description
TimeSpan
View Source

MonthEnd(int, int)

Get the month end date in UTC

Declaration
public static DateTime MonthEnd(int year, int month)
Parameters
Type Name Description
int year
int month
Returns
Type Description
DateTime
View Source

MonthStart(int, int)

Get the month start date in UTC

Declaration
public static DateTime MonthStart(int year, int month)
Parameters
Type Name Description
int year
int month
Returns
Type Description
DateTime
View Source

Parse(string)

Parse date time string

Declaration
public static DateTime? Parse(string dateValue)
Parameters
Type Name Description
string dateValue

The date value

Returns
Type Description
DateTime?

Valid date or null

View Source

YearEnd(int)

Get the year-end date in UTC

Declaration
public static DateTime YearEnd(int year)
Parameters
Type Name Description
int year
Returns
Type Description
DateTime
View Source

YearStart(int)

Get the year start date in UTC

Declaration
public static DateTime YearStart(int year)
Parameters
Type Name Description
int year
Returns
Type Description
DateTime
  • View Source
☀
☾
Back to top Generated by DocFX