|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jcontrol.system.Time
public class Time
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 |
---|
public static final int SUN
public static final int MON
public static final int TUE
public static final int WED
public static final int THU
public static final int FRI
public static final int SAT
public int year
public int month
public int day
public int dow
SUN
, MON
, TUE
, WED
, THU
,
FRI
, SAT
(0..6)
public int hour
public int minute
public int second
public int millis
Constructor Detail |
---|
public Time()
RTC
is used to get now.
public Time(int y, int m, int d, int wd, int h, int min, int sec)
new Time(2003,1,28,Time.TUE, 10,31,2)
.
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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |