waba.sys
Class Time

java.lang.Object
  |
  +--waba.sys.Time

public final class Time
extends java.lang.Object

Time identifies a date and time.

Here is an example of Time being used to display the current date:

 Time t = new Time();
 ...
 g.drawText("Today is " + t.year + "/" + t.month + "/" + t.day);
 


Field Summary
 int day
          The day in the range of 1 to the last day in the month.
 int hour
          The hour in the range of 0 to 23.
 int millis
          Milliseconds in the range of 0 to 999.
 int minute
          The minute in the range of 0 to 59.
 int month
          The month in the range of 1 to 12.
 int second
          The second in the range of 0 to 59.
 int year
          The year as its full set of digits (year 2010 is 2010).
 
Constructor Summary
Time()
          Constructs a time object set to the current date and time.
Time(int year, int month, int day, int hour, int minute, int second, int millis)
          Constructs a new time with the given values.
Time(long t)
          Constructs a time object from the given value.
Time(java.lang.String iso8601)
          Converts this time object to a string in the Iso8601 format: YYYYMMDDTHH:MM:SS.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 long getTimeLong()
          Returns the time in the format YYYYMMDDHHMMSS as a long value.
 java.lang.String toIso8601()
          Converts this time object to a string in the Iso8601 format: YYYYMMDDTHH:MM:SS.
 java.lang.String toString()
          returns the time in format specified in waba.sys.Settings.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

year

public int year
The year as its full set of digits (year 2010 is 2010).

month

public int month
The month in the range of 1 to 12.

day

public int day
The day in the range of 1 to the last day in the month.

hour

public int hour
The hour in the range of 0 to 23.

minute

public int minute
The minute in the range of 0 to 59.

second

public int second
The second in the range of 0 to 59.

millis

public int millis
Milliseconds in the range of 0 to 999.
Constructor Detail

Time

public Time()
Constructs a time object set to the current date and time.

Time

public Time(long t)
Constructs a time object from the given value. It must have been got with the getTimeLong method.
Since:
SuperWaba 4.0

Time

public Time(java.lang.String iso8601)
Converts this time object to a string in the Iso8601 format:
YYYYMMDDTHH:MM:SS
.
Since:
SuperWaba 5.61

Time

public Time(int year,
            int month,
            int day,
            int hour,
            int minute,
            int second,
            int millis)
Constructs a new time with the given values. The values are not checked.
Since:
SuperWaba 3.5
Method Detail

getTimeLong

public long getTimeLong()
Returns the time in the format YYYYMMDDHHMMSS as a long value. It does not include the millis.
Since:
SuperWaba 4.0

toString

public java.lang.String toString()
returns the time in format specified in waba.sys.Settings. To return the date, use class waba.util.Date.
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toIso8601

public java.lang.String toIso8601()
Converts this time object to a string in the Iso8601 format:
YYYYMMDDTHH:MM:SS
.
Since:
SuperWaba 5.61