public class NCDateTime
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
static int |
DaysTo1970 |
Number of days from 1/1/0001 to 12/31/1969
|
static long |
MaxTicks |
MaxTicks is DaysTo10000 * TicksPerDay - 1;
|
static java.util.Date |
MaxValue |
MaxValue
|
static long |
MinTicks |
MinTicks of the Instance
|
static java.util.Date |
MinValue |
MinValue is new Date of MinTicks
|
Constructor | Description |
---|---|
NCDateTime(int year,
int month,
int day,
int hours,
int minutes,
int seconds,
int milliseconds) |
Initializes a new instance of the NCDateTime class to the specified year, month, day, hour, minute, second, and millisecond.
|
NCDateTime(long ticks) |
Initializes a new instance of the NCDateTime class to a specified number of ticks.
|
NCDateTime(java.util.Date date) |
Initializes a new instance of the NCDateTime class to the specified date.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addDays(double value) |
Adds the specified number of days to the value of this instance.
|
java.util.Date |
AddMonths(int months) |
Returns a new Date that adds the specified number of months to the value of this instance.
|
void |
addTicks(long ticks) |
Adds adds the specified number of ticks to the value of this instance.
|
java.util.Date |
AddYears(int value) |
Returns a new Date that adds the specified number of years to the value of this instance.
|
static int |
DaysInMonth(int year,
int month) |
|
java.util.Date |
getDate() |
Returns the java.util.Date value corresponding to this NCDateTime instance.
|
int |
getDay() |
Gets the day of the month represented by this instance.
|
static java.util.Date |
getDefaultDate() |
Gets the default value of NCDateTime i.e.
|
int |
getHours() |
Gets the hour component of the date represented by this instance.
|
java.util.Date |
getLocalizedDate() |
Returns the java.util.Date value corresponding to this instance after converting to local time.
|
long |
getLocalizedTimeInTicks() |
Gets the ticks corresponding to the current local time.
|
int |
getMilliseconds() |
Gets the milliseconds component of the date represented by this instance.
|
int |
getMinutes() |
Gets the minute component of the date represented by this instance.
|
int |
getMonth() |
Gets the month component of the date represented by this instance.
|
int |
getSeconds() |
Gets the seconds component of the date represented by this instance.
|
long |
getTicks() |
Gets the number of ticks that represent the date and time of this instance.
|
static java.util.Date |
getUTCDate(java.util.Date date) |
Gets an NCDateTime object that converts the specified date to UTC equivalent.
|
static java.util.Date |
getUTCNow() |
Gets a DateTime object that is set to the current date and time on this
computer, expressed as the Coordinated Universal Time (UTC).
|
int |
getYear() |
Gets the year component of the date represented by this instance.
|
public static final int DaysTo1970
public static final long MinTicks
public static final long MaxTicks
public static final java.util.Date MinValue
public static final java.util.Date MaxValue
public NCDateTime(int year, int month, int day, int hours, int minutes, int seconds, int milliseconds) throws java.lang.IllegalArgumentException
year
- The year (1 through 9999).month
- The month (1 through 12).day
- The day (1 through the number of days in month).hours
- The hours (0 through 23).minutes
- The minutes (0 through 59).seconds
- The seconds (0 through 59).milliseconds
- The milliseconds (0 through 999).java.lang.IllegalArgumentException
public NCDateTime(java.util.Date date) throws java.lang.IllegalArgumentException
date
- The date that is to be set.java.lang.IllegalArgumentException
public NCDateTime(long ticks)
ticks
- A date and time expressed in the number of 100-nanosecond intervals that have elapsed since January 1, 0001 at 00:00:00.000 in the Gregorian calendar.public void addTicks(long ticks)
ticks
- A number of 100-nanosecond ticks. The value parameter can be positive or negative.public static java.util.Date getUTCNow()
public static java.util.Date getUTCDate(java.util.Date date) throws java.text.ParseException
java.text.ParseException
public int getDay()
public int getHours()
public int getMilliseconds()
public int getMinutes()
public int getMonth()
public int getSeconds()
public int getYear()
public java.util.Date AddYears(int value) throws java.lang.IllegalArgumentException
value
- A number of years. The value parameter can be negative or positive.java.lang.IllegalArgumentException
public java.util.Date AddMonths(int months) throws java.lang.IllegalArgumentException
months
- A number of months. The months parameter can be negative or positive.java.lang.IllegalArgumentException
public static int DaysInMonth(int year, int month) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public long getTicks()
public java.util.Date getDate()
public java.util.Date getLocalizedDate()
public long getLocalizedTimeInTicks()
public static java.util.Date getDefaultDate()
public void addDays(double value)
value
- A number of whole and fractional days. The value parameter can be negative or positive.