com.spss.psapi.data

Interface MDatetime

  • All Known Subinterfaces:
    MDate, MTime, MTimestamp


    public interface MDatetime
    This identifies a Modeler date/time value.
    Since:
    PSAPI 18.1
    Version:
    1.0
    Author:
    Julian Clinton
    See Also:
    MDate, MTime, MTimestamp
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      int getDay()
      Returns the day component from this date/time.
      int getHour()
      Returns the hour component from this date/time.
      int getMinute()
      Returns the minute component from this date/time.
      int getMonth()
      Returns the month component from this date/time.
      int getSecond()
      Returns the second component from this date/time, as an integer.
      int getYear()
      Returns the year component of this date/time.
      java.util.Date toDate(java.util.Calendar calendar)
      Returns this date/time value as a Date using the specified calendar.
      long toMilliseconds()
      Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this value.
      java.util.Date toUTCDate()
      Returns this date/time value as a Date using the UTC timezone and Gregorian calendar.
    • Method Detail

      • getYear

        int getYear()
        Returns the year component of this date/time. The default year is the year 1.
      • getMonth

        int getMonth()
        Returns the month component from this date/time. The default month is the month 1 (January).
      • getDay

        int getDay()
        Returns the day component from this date/time. The default day is the day 1.
      • getHour

        int getHour()
        Returns the hour component from this date/time. The default hour is 0 (midnight).
      • getMinute

        int getMinute()
        Returns the minute component from this date/time. The default minute is 0.
      • getSecond

        int getSecond()
        Returns the second component from this date/time, as an integer. The default second is 0.
      • toDate

        java.util.Date toDate(java.util.Calendar calendar)
        Returns this date/time value as a Date using the specified calendar. Updates the calendar fields from this date/time and calls the calendar's getTime method. Note that this calls Calendar.clear() on the supplied calendar.
        Parameters:
        calendar - the calendar to use for date/time conversion
      • toUTCDate

        java.util.Date toUTCDate()
        Returns this date/time value as a Date using the UTC timezone and Gregorian calendar. Since Modeler dates/times do not include timezone information, this assumes the date/time is already based on UTC.
      • toMilliseconds

        long toMilliseconds()
        Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this value. This is equivalent to calling:
        
         date.toUTCDate().getTime()
         
        Returns:
        the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this value

(C) Copyright IBM Corp. 1994, 2015. All Rights Reserved.