dxFeed .Net API  5.8.0
dxFeed .Net API library intended to provide market data access for DX clients
Static Public Member Functions | Private Member Functions | Static Private Attributes
com.dxfeed.util.DayUtil Class Reference

A collection of static utility methods for manipulation of int day id, that is the number of days since Unix epoch of January 1, 1970. More...

Static Public Member Functions

static int GetDayIdByYearMonthDay (int year, int month, int day)
 Returns day identifier for specified year, month and day in Gregorian calendar. The day identifier is defined as the number of days since Unix epoch of January 1, 1970. Month must be between 1 and 12 inclusive.Year and day might take arbitrary values assuming proleptic Gregorian calendar.The value returned by this method for an arbitrary day value always satisfies the following equality: { More...
 
static int GetDayIdByYearMonthDay (int yyyymmdd)
 Returns day identifier for specified yyyymmdd integer in Gregorian calendar. The day identifier is defined as the number of days since Unix epoch of January 1, 1970. The yyyymmdd integer is equal to yearSign * (abs(year) * 10000 + month * 100 + day), where year, month, and day are in Gregorian calendar, month is between 1 and 12 inclusive, and day is counted from 1. More...
 
static int GetYearMonthDayByDayId (int dayId)
 Returns yyyymmdd integer in Gregorian calendar for a specified day identifier. The day identifier is defined as the number of days since Unix epoch of January 1, 1970. The result is equal to yearSign * (abs(year) * 10000 + month * 100 + day), where year, month, and day are in Gregorian calendar, month is between 1 and 12 inclusive, and day is counted from 1. More...
 

Private Member Functions

 DayUtil ()
 

Static Private Attributes

static readonly int [] DAY_OF_YEAR = { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }
 

Detailed Description

A collection of static utility methods for manipulation of int day id, that is the number of days since Unix epoch of January 1, 1970.

Constructor & Destructor Documentation

◆ DayUtil()

com.dxfeed.util.DayUtil.DayUtil ( )
inlineprivate

Member Function Documentation

◆ GetDayIdByYearMonthDay() [1/2]

static int com.dxfeed.util.DayUtil.GetDayIdByYearMonthDay ( int  year,
int  month,
int  day 
)
inlinestatic

Returns day identifier for specified year, month and day in Gregorian calendar. The day identifier is defined as the number of days since Unix epoch of January 1, 1970. Month must be between 1 and 12 inclusive.Year and day might take arbitrary values assuming proleptic Gregorian calendar.The value returned by this method for an arbitrary day value always satisfies the following equality: {

GetDayIdByYearMonthDay(year, month, day) == GetDayIdByYearMonthDay(year, month, 0) + day

}

Exceptions
ArgumentOutOfRangeExceptionwhen month is less than 1 or more than 12.
Parameters
yearyear
monthmonth
dayday
Returns
Returns day identifier for specified year, month and day in Gregorian calendar.

◆ GetDayIdByYearMonthDay() [2/2]

static int com.dxfeed.util.DayUtil.GetDayIdByYearMonthDay ( int  yyyymmdd)
inlinestatic

Returns day identifier for specified yyyymmdd integer in Gregorian calendar. The day identifier is defined as the number of days since Unix epoch of January 1, 1970. The yyyymmdd integer is equal to yearSign * (abs(year) * 10000 + month * 100 + day), where year, month, and day are in Gregorian calendar, month is between 1 and 12 inclusive, and day is counted from 1.

Exceptions
ArgumentOutOfRangeExceptionwhen month is less than 1 or more than 12.
See also
GetDayIdByYearMonthDay(int year, int month, int day)
Parameters
yyyymmdd
Returns

◆ GetYearMonthDayByDayId()

static int com.dxfeed.util.DayUtil.GetYearMonthDayByDayId ( int  dayId)
inlinestatic

Returns yyyymmdd integer in Gregorian calendar for a specified day identifier. The day identifier is defined as the number of days since Unix epoch of January 1, 1970. The result is equal to yearSign * (abs(year) * 10000 + month * 100 + day), where year, month, and day are in Gregorian calendar, month is between 1 and 12 inclusive, and day is counted from 1.

Parameters
dayId
Returns

Field Documentation

◆ DAY_OF_YEAR

readonly int [] com.dxfeed.util.DayUtil.DAY_OF_YEAR = { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }
staticprivate

The documentation for this class was generated from the following file: