Class StiDateTime

java.lang.Object
com.stimulsoft.base.system.StiDateTime
All Implemented Interfaces:
Cloneable, Comparable<Object>
Direct Known Subclasses:
StiDateTimeOffset

public class StiDateTime extends Object implements Cloneable, Comparable<Object>
  • Field Details

  • Constructor Details

    • StiDateTime

      public StiDateTime()
    • StiDateTime

      public StiDateTime(Calendar calendar)
    • StiDateTime

      public StiDateTime(ZonedDateTime date)
    • 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

      public StiDateTime(Date date)
    • StiDateTime

      public StiDateTime(Long ticks)
    • StiDateTime

      public StiDateTime(StiTimeSpan value)
    • StiDateTime

      public StiDateTime(StiDateTime value)
    • StiDateTime

      public StiDateTime(double oaDate)
  • Method Details

    • date

      public StiDateTime date()
    • currentDate

      public static StiDateTime currentDate()
    • now

      public static StiDateTime now()
    • today

      public static StiDateTime today()
    • currentDateOnly

      public static StiDateTime currentDateOnly()
    • toNetJsonString

      public String toNetJsonString()
    • fromNetJsonString

      public static StiDateTime fromNetJsonString(String jsonDate)
    • zonedDateTime

      public ZonedDateTime zonedDateTime()
    • getTicks

      public long getTicks()
    • Parse

      public static StiDateTime Parse(String from)
    • parseFromFormat

      public static StiDateTime parseFromFormat(String from, StiDateTime dateFormat)
    • fromString

      public static StiDateTime fromString(String strFrom)
    • parseISO8601

      public static Date parseISO8601(String input) throws ParseException
      Throws:
      ParseException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(String format)
    • toString

      public String toString(String format, Locale locale)
    • format

      public String format(String format)
    • format

      public String format(String format, Locale locale)
    • format

      public String format(DateTimeFormatter df)
    • formatEN

      public String formatEN()
    • formatEnDateTime

      public String formatEnDateTime()
    • setTimeSpan

      public void setTimeSpan(StiTimeSpan value)
    • getDayOfWeek

      public int getDayOfWeek()
    • addDays

      public StiDateTime addDays(long days)
      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

      public StiDateTime addHours(long hours)
      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

      public StiDateTime addMilliseconds(long milliseconds)
      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

      public StiDateTime addMinutes(long minutes)
      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

      public StiDateTime addMonths(int months)
      Returns the DateTime resulting from adding the given number of months to this DateTime.
      Parameters:
      months -
      Returns:
    • addSeconds

      public StiDateTime addSeconds(long seconds)
      Returns the DateTime resulting from adding a fractional number of seconds to this DateTime.
      Parameters:
      seconds -
      Returns:
    • addYears

      public StiDateTime addYears(int years)
      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

      public StiDateTime clone()
      Overrides:
      clone in class Object
    • format

      public String format()
    • subtract

      public StiTimeSpan subtract(StiDateTime subtrahend)
    • compareTo

      public int compareTo(Object o)
      Specified by:
      compareTo in interface Comparable<Object>
    • valueOf

      public static StiDateTime valueOf(Object o)
    • toOADate

      public double toOADate()
    • toCalendar

      public Calendar toCalendar()
    • getTimeOfDay

      public StiTimeOnly getTimeOfDay()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • year

      public int year()
    • month

      public int month()
    • day

      public int day()
    • hour

      public int hour()
    • minute

      public int minute()
    • second

      public int second()