jcontrol.system
Class Time

java.lang.Object
  extended by jcontrol.system.Time

public class Time
extends Object

Time identifies a date and time.

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

 Time t = new Time();
 ...
 g.drawText("Current day of month: ".concat(String.valueOf(t.day)));
 


Field Summary
 int day
          The day in the range of 1 to the last day in the month.
 int dow
          Day of week, one of SUN, MON, TUE, WED, THU, FRI, SAT (0..6)
static int FRI
          Weekday code
 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.
static int MON
          Weekday code
 int month
          The month in the range of 1 to 12.
static int SAT
          Weekday code
 int second
          The second in the range of 0 to 59.
static int SUN
          Weekday code
static int THU
          Weekday code
static int TUE
          Weekday code
static int WED
          Weekday code
 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 y, int m, int d, int wd, int h, int min, int sec)
          Constructs a time object for a specific point of time, e.g.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, getClass, notifyAll, toString, wait
 

Field Detail

SUN

public static final int SUN
Weekday code

See Also:
Constant Field Values

MON

public static final int MON
Weekday code

See Also:
Constant Field Values

TUE

public static final int TUE
Weekday code

See Also:
Constant Field Values

WED

public static final int WED
Weekday code

See Also:
Constant Field Values

THU

public static final int THU
Weekday code

See Also:
Constant Field Values

FRI

public static final int FRI
Weekday code

See Also:
Constant Field Values

SAT

public static final int SAT
Weekday code

See Also:
Constant Field Values

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.


dow

public int dow
Day of week, one of SUN, MON, TUE, WED, THU, FRI, SAT (0..6)


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. The RTC is used to get now.


Time

public Time(int y,
            int m,
            int d,
            int wd,
            int h,
            int min,
            int sec)
Constructs a time object for a specific point of time, e.g. new Time(2003,1,28,Time.TUE, 10,31,2).

Parameters:
y - the year to use (range 1980 ... 2079)
m - the month to use (range 1 ... 12)
d - the day of month to use (range 1 ... last day of month)
wd - the day of week, one of SUN, MON, TUE, WED, THU, FRI, SAT (range 0 ... 6)
h - the hour of day (range 0 ... 23)
min - the minutes (range 0 ... 59)
sec - the seconds (range 0 ... 59)