Date :: Date - Constructor
The function creates a date value.
Implementation overview
- Copy constructor
Date :: Date ( cDate ) - Set date value by day, month and year
Date :: Date ( iDay, iMonth, iYear ) - Set current date value
Date :: Date (  ) - Set date value from string
Date :: Date ( sDate ) - Create date from value
Date :: Date ( cValue )
Implementation details
-
Copy constructor
Date  :: Date ( odaba::Date &cDate )
The constructor creates a copy from the time value passed in cDate.
- cDate
- Date
The date contains day, month and year, but not the time.
to list
- cDate
- Date
-
Set date value by day, month and year
Date  :: Date ( int32 iDay, int32 iMonth, int32 iYear )
The function changes the date value to day, month and year passed in iDay, iMonth and iYear. When the day or month value exceeds the number of days in the defined month or 12, the month and year value will increase automatically.
When iDay, iMonth are less than 1 or iYear is less than 1870, the function throws an exception.
- iDay
- Day
Day of the month. The value should range between 1 and 31.
- iMonth
- Month
Month of the year. The value should range between 1 and 12.
- iYear
- Year
Number of the year. The value should no be negative.
to list
- iDay
- Day
-
Set current date value
Date  :: Date (  )
The function initializes date to the current date.
to list
-
Set date value from string
Date  :: Date ( odaba::String &sDate )
The function sets the date value from the string date passed in sDate. When no date format has been set, the date format is detected automatically from string value as follows:
- contains '.' - DD.MM.YYYY or DD.MM.YY
- contains '/' - MM/DD/YYYY or MM/DD/YY
- contains '-' - YYYY-MM-DD or YY-MM-DD
- else - YYYYMMDD or YYMMDD
- sDate
- Date value in string format
Date values can be passed in different ways as string value:
Standard: yyyy-mm-dd or yyyymmdd
English: mm/dd/yyyy
German: dd.mm.yyyy
The type of date is determined from the separator used.
to list
-
Create date from value
Date  :: Date ( odaba::Value &cValue )
The function creates a date from the value passed in cValue.
- cValue
- Value handle
A value handle refers to a (usually) opened value. Invalid value handles may cause an exception.
to list
- cValue
- Value handle