Package com.stimulsoft.base.system
Class StiDateTime
java.lang.Object
com.stimulsoft.base.system.StiDateTime
- All Implemented Interfaces:
Cloneable,Comparable<Object>
- Direct Known Subclasses:
StiDateTimeOffset
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic StiDateTimestatic StiDateTimestatic StiDateTimestatic final Stringstatic StiDateTime -
Constructor Summary
ConstructorsConstructorDescriptionStiDateTime(double oaDate) StiDateTime(int year, int month, int day) StiDateTime(int year, int month, int day, int hour, int min, int sec) StiDateTime(StiDateTime value) StiDateTime(StiTimeSpan value) StiDateTime(Long ticks) StiDateTime(ZonedDateTime date) StiDateTime(Calendar calendar) StiDateTime(Date date) -
Method Summary
Modifier and TypeMethodDescriptionaddDays(long days) Returns the DateTime resulting from adding a fractional number of days to this DateTime.addHours(long hours) Returns the DateTime resulting from adding a fractional number of hours to this DateTime.addMilliseconds(long milliseconds) Returns the DateTime resulting from the given number of milliseconds to this DateTime.addMinutes(long minutes) Returns the DateTime resulting from adding a fractional number of minutes to this DateTime.addMonths(int months) Returns the DateTime resulting from adding the given number of months to this DateTime.addSeconds(long seconds) Returns the DateTime resulting from adding a fractional number of seconds to this DateTime.addYears(int years) Returns the DateTime resulting from adding the given number of years to this DateTime.clone()intstatic StiDateTimestatic StiDateTimedate()intday()static intdaysInMonth(long year, long month) Returns the number of days in the month given by the year and month arguments.booleanformat()formatEN()static StiDateTimefromNetJsonString(String jsonDate) static StiDateTimefromString(String strFrom) intlonggetTicks()inthour()static booleanisLeapYear(long year) Checks whether a given year is a leap year.intminute()intmonth()static StiDateTimenow()static StiDateTimestatic StiDateTimeparseFromFormat(String from, StiDateTime dateFormat) static DateparseISO8601(String input) intsecond()voidsetTimeSpan(StiTimeSpan value) subtract(StiDateTime subtrahend) static StiDateTimetoday()doubletoOADate()toString()static StiDateTimeintyear()
-
Field Details
-
EN_DATE_TIME_FORMAT
- See Also:
-
DATE_TIME_FORMAT
- See Also:
-
DATE_FORMAT
- See Also:
-
TIME_FORMAT
- See Also:
-
ZERO
-
minValue
-
MinValue
-
MaxValue
-
-
Constructor Details
-
StiDateTime
public StiDateTime() -
StiDateTime
-
StiDateTime
-
StiDateTime
public StiDateTime(int year, int month, int day) -
StiDateTime
public StiDateTime(int year, int month, int day, int hour, int min, int sec) -
StiDateTime
-
StiDateTime
-
StiDateTime
-
StiDateTime
-
StiDateTime
public StiDateTime(double oaDate)
-
-
Method Details
-
date
-
currentDate
-
now
-
today
-
currentDateOnly
-
toNetJsonString
-
fromNetJsonString
-
zonedDateTime
-
getTicks
public long getTicks() -
Parse
-
parseFromFormat
-
fromString
-
parseISO8601
- Throws:
ParseException
-
toString
-
toString
-
toString
-
format
-
format
-
format
-
formatEN
-
formatEnDateTime
-
setTimeSpan
-
getDayOfWeek
public int getDayOfWeek() -
addDays
Returns the DateTime resulting from adding a fractional number of days to this DateTime. The result is computed by rounding the fractional number of days given by value to the nearest millisecond, and adding that interval to this DateTime. The value argument is permitted to be negative.- Parameters:
value-- Returns:
-
addHours
Returns the DateTime resulting from adding a fractional number of hours to this DateTime. The result is computed by rounding the fractional number of hours given by value to the nearest millisecond, and adding that interval to this DateTime. The value argument is permitted to be negative.- Parameters:
value-- Returns:
-
addMilliseconds
Returns the DateTime resulting from the given number of milliseconds to this DateTime. The result is computed by rounding the number of milliseconds given by value to the nearest integer, and adding that interval to this DateTime. The value argument is permitted to be negative.- Parameters:
value-- Returns:
-
addMinutes
Returns the DateTime resulting from adding a fractional number of minutes to this DateTime. The result is computed by rounding the fractional number of minutes given by value to the nearest millisecond, and adding that interval to this DateTime. The value argument is permitted to be negative.- Parameters:
value-- Returns:
-
addMonths
Returns the DateTime resulting from adding the given number of months to this DateTime.- Parameters:
months-- Returns:
-
addSeconds
Returns the DateTime resulting from adding a fractional number of seconds to this DateTime.- Parameters:
seconds-- Returns:
-
addYears
Returns the DateTime resulting from adding the given number of years to this DateTime.- Parameters:
years-- Returns:
-
daysInMonth
public static int daysInMonth(long year, long month) Returns the number of days in the month given by the year and month arguments.- Parameters:
year-month-- Returns:
-
isLeapYear
public static boolean isLeapYear(long year) Checks whether a given year is a leap year. This method returns true if year is a leap year, or false if not.- Parameters:
year-- Returns:
-
clone
-
format
-
subtract
-
compareTo
- Specified by:
compareToin interfaceComparable<Object>
-
valueOf
-
toOADate
public double toOADate() -
toCalendar
-
getTimeOfDay
-
equals
-
year
public int year() -
month
public int month() -
day
public int day() -
hour
public int hour() -
minute
public int minute() -
second
public int second()
-