jodd.datetime
Class DateTimeStamp

java.lang.Object
  extended byjodd.datetime.DateTimeStamp
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public class DateTimeStamp
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

Generic date time stamp just stores and holds date and time information. This class does not contain any date/time manipulation.

See Also:
JDateTime, Serialized Form

Field Summary
 int day
          Day, range: [1 - 31]
 int hour
          Hour, range: [0 - 23]
 int minute
          Minute, range [0 - 59]
 int month
          Month, range: [1 - 12]
 double second
          Second, range: [0.000 - 59.999]
 int year
          Year
 
Constructor Summary
DateTimeStamp()
          Default empty constructor.
DateTimeStamp(int year, int month, int day)
          Constructor that sets just date.
DateTimeStamp(int year, int month, int day, int hour, int minute, double second)
          Constructor that sets date and time.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this object with the specified object for order.
 java.lang.String toString()
          Simple to string conversion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

year

public int year
Year


month

public int month
Month, range: [1 - 12]


day

public int day
Day, range: [1 - 31]


hour

public int hour
Hour, range: [0 - 23]


minute

public int minute
Minute, range [0 - 59]


second

public double second
Second, range: [0.000 - 59.999]

Constructor Detail

DateTimeStamp

public DateTimeStamp()
Default empty constructor.


DateTimeStamp

public DateTimeStamp(int year,
                     int month,
                     int day,
                     int hour,
                     int minute,
                     double second)
Constructor that sets date and time.


DateTimeStamp

public DateTimeStamp(int year,
                     int month,
                     int day)
Constructor that sets just date. Time is set to zeros.

Method Detail

compareTo

public int compareTo(java.lang.Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this Object.

toString

public java.lang.String toString()
Simple to string conversion.

Returns:
date/time string in 'y-m-d h:m:m.s' format


Jodd v0.24.5 Javadoc