asposediagram.api

Class DateTime

Represents an instant in time, typically expressed as a date and time of day.

Constructor Summary
DateTime(year, month, day)
Initializes a new instance of the DateTime object to the specified year, month, and day.
DateTime(year, month, day, hour, minute, second)
Initializes a new instance of the DateTime object to the specified year, month, day, hour, minute, and second.
DateTime(year, month, day, hour, minute, second, millisecond)
Initializes a new instance of the DateTime object to the specified year, month, day, hour, minute, second, and millisecond.
DateTime(date)
Initializes a new instance of the DateTime object to the specified Date object
DateTime(cld)
Initializes a new instance of the DateTime object to the specified Calendar object
 
Method Summary
methodaddDays(value)
Adds the specified number of days to the value of this instance.
methodaddHours(value)
Adds the specified number of hours to the value of this instance.
methodaddMilliseconds(value)
Adds the specified number of milliseconds to the value of this instance.
methodaddMinutes(value)
Adds the specified number of minutes to the value of this instance.
methodaddMonths(months)
Adds the specified number of months to the value of this instance.
methodaddSeconds(value)
Adds the specified number of seconds to the value of this instance.
methodaddYears(value)
Adds the specified number of years to the value of this instance.
methodcompareTo(value)
Compares the value of this instance to a specified DateTime value and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified DateTime value.
methodcompareTo(value)
Compares the value of this instance to a specified object that contains a specified DateTime value, and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified DateTime value.
methodequals(value)
Returns a value indicating whether this instance is equal to a specified object.
methodgetDay()
Gets the day of the month represented by this instance.
methodgetDayOfWeek()
Gets the day of the week represented by this instance.
methodgetDayOfYear()
Gets the day of the year represented by this instance.
methodgetHour()
Gets the hour component of the date represented by this instance.
methodgetMillisecond()
Gets the milliseconds component of the date represented by this instance.
methodgetMinute()
Gets the minute component of the date represented by this instance.
methodgetMonth()
Gets the month component of the date represented by this instance.
static methodgetNow()
Gets a DateTime object that is set to the current date and time on this computer, expressed as the local time.
methodgetSecond()
Gets the seconds component of the date represented by this instance.
methodgetYear()
Gets the year component of the date represented by this instance.
methodhashCode()
Returns the hash code for this instance.
methodtoCalendar()
Converts the value of the current DateTime object to Calendar object.
methodtoDate()
Converts the value of the current DateTime object to Date object.
methodtoString()
Converts the value of the current DateTime object to its equivalent string representation.
 

    • Constructor Detail

      • DateTime

        DateTime(year, month, day)
        Initializes a new instance of the DateTime object to the specified year, month, and day.
        Parameters:
        year: int - The year (1 through 9999).
        month: int - The month (1 through 12).
        day: int - The day (1 through the number of days in month).
      • DateTime

        DateTime(year, month, day, hour, minute, second)
        Initializes a new instance of the DateTime object to the specified year, month, day, hour, minute, and second.
        Parameters:
        year: int - The year (1 through 9999).
        month: int - The month (1 through 12).
        day: int - The day (1 through the number of days in month).
        hour: int - The hours (0 through 23).
        minute: int - The minutes (0 through 59).
        second: int - The seconds (0 through 59).
      • DateTime

        DateTime(year, month, day, hour, minute, second, millisecond)
        Initializes a new instance of the DateTime object to the specified year, month, day, hour, minute, second, and millisecond.
        Parameters:
        year: int - The year (1 through 9999).
        month: int - The month (1 through 12).
        day: int - The day (1 through the number of days in month).
        hour: int - The hours (0 through 23).
        minute: int - The minutes (0 through 59).
        second: int - The seconds (0 through 59).
        millisecond: int - The milliseconds (0 through 999).
      • DateTime

        DateTime(date)
        Initializes a new instance of the DateTime object to the specified Date object
        Parameters:
        date: Date - The Date object
      • DateTime

        DateTime(cld)
        Initializes a new instance of the DateTime object to the specified Calendar object
        Parameters:
        cld: Calendar - The Calendar object
    • Method Detail

      • toDate

        Date toDate()
        Converts the value of the current DateTime object to Date object.
        Returns:
        Date object
      • toCalendar

        Calendar toCalendar()
        Converts the value of the current DateTime object to Calendar object.
        Returns:
        Calendar object
      • addDays

        DateTime addDays(value)
        Adds the specified number of days to the value of this instance.
        Parameters:
        value: float - A number of whole and fractional days. The value parameter can be negative or positive.
        Returns:
        A DateTime object whose value is the sum of the date and time represented by this instance and the number of days represented by value.
      • addHours

        DateTime addHours(value)
        Adds the specified number of hours to the value of this instance.
        Parameters:
        value: float - A number of whole and fractional hours. The value parameter can be negative or positive.
        Returns:
        A DateTime object whose value is the sum of the date and time represented by this instance and the number of hours represented by value.
      • addMilliseconds

        DateTime addMilliseconds(value)
        Adds the specified number of milliseconds to the value of this instance.
        Parameters:
        value: float - A number of whole and fractional milliseconds. The value parameter can be negative or positive. Note that this value is rounded to the nearest integer.
        Returns:
        A DateTime object whose value is the sum of the date and time represented by this instance and the number of milliseconds represented by value.
      • addMinutes

        DateTime addMinutes(value)
        Adds the specified number of minutes to the value of this instance.
        Parameters:
        value: float - A number of whole and fractional minutes. The value parameter can be negative or positive.
        Returns:
        A DateTime object whose value is the sum of the date and time represented by this instance and the number of minutes represented by value.
      • addMonths

        DateTime addMonths(months)
        Adds the specified number of months to the value of this instance.
        Parameters:
        months: int - A number of months. The months parameter can be negative or positive.
        Returns:
        A DateTime object whose value is the sum of the date and time represented by this instance and months.
      • addSeconds

        DateTime addSeconds(value)
        Adds the specified number of seconds to the value of this instance.
        Parameters:
        value: float - A number of whole and fractional seconds. The value parameter can be negative or positive.
        Returns:
        A DateTime object whose value is the sum of the date and time represented by this instance and the number of seconds represented by value.
      • addYears

        DateTime addYears(value)
        Adds the specified number of years to the value of this instance.
        Parameters:
        value: int - A number of years. The value parameter can be negative or positive.
        Returns:
        A DateTime object whose value is the sum of the date and time represented by this instance and the number of years represented by value.
      • compareTo

        int compareTo(value)
        Compares the value of this instance to a specified object that contains a specified DateTime value, and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified DateTime value.
        Parameters:
        value: Object - A boxed DateTime object to compare, or null.
        Returns:
        A signed number indicating the relative values of this instance and value. Value Description Less than zero This instance is earlier than value. Zero This instance is the same as value. Greater than zero This instance is later than value, or value is null.
      • compareTo

        int compareTo(value)
        Compares the value of this instance to a specified DateTime value and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified DateTime value.
        Parameters:
        value: DateTime - A DateTime object to compare.
        Returns:
        A signed number indicating the relative values of this instance and the value parameter. Value Description Less than zero This instance is earlier than value. Zero This instance is the same as value. Greater than zero This instance is later than value.
      • hashCode

        int hashCode()
        Returns the hash code for this instance.
        Returns:
        A 32-bit signed integer hash code.
      • equals

        boolean equals(value)
        Returns a value indicating whether this instance is equal to a specified object.
        Parameters:
        value: Object - An object to compare to this instance.
        Returns:
        true if value is an instance of DateTime and equals the value of this instance; otherwise, false.
      • getDay

        int getDay()
        Gets the day of the month represented by this instance.
        Returns:
        The day component, expressed as a value between 1 and 31.
      • getDayOfWeek

        int getDayOfWeek()
        Gets the day of the week represented by this instance.
        Returns:
        the day of the week of this DateTime value.
      • getDayOfYear

        int getDayOfYear()
        Gets the day of the year represented by this instance.
        Returns:
        The day of the year, expressed as a value between 1 and 366.
      • getHour

        int getHour()
        Gets the hour component of the date represented by this instance.
        Returns:
        The hour component, expressed as a value between 0 and 23.
      • getMillisecond

        int getMillisecond()
        Gets the milliseconds component of the date represented by this instance.
        Returns:
        The milliseconds component, expressed as a value between 0 and 999.
      • getMinute

        int getMinute()
        Gets the minute component of the date represented by this instance.
        Returns:
        The minute component, expressed as a value between 0 and 59.
      • getMonth

        int getMonth()
        Gets the month component of the date represented by this instance.
        Returns:
        The month component, expressed as a value between 1 and 12.
      • getNow

        static DateTime getNow()
        Gets a DateTime object that is set to the current date and time on this computer, expressed as the local time.
        Returns:
        A DateTime object whose value is the current local date and time.
      • getSecond

        int getSecond()
        Gets the seconds component of the date represented by this instance.
        Returns:
        The seconds, between 0 and 59.
      • getYear

        int getYear()
        Gets the year component of the date represented by this instance.
        Returns:
        The year, between 1 and 9999.
      • toString

        String toString()
        Converts the value of the current DateTime object to its equivalent string representation.
        Returns:
        A string representation of the value of the current DateTime object.