|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.lanl.Utility.DateTime
Provides a date/time class to support the data in the TeleMed server Date and time are saved together as a double, with the integer part the Julian date, and the fractional part the time in hours (24 hour standard) divided by 24, down to seconds. ALWAYS GMT! Thus every time stamp in the TeleMed data base has date and time.
The julian conversions are modelled after "Numerical Recipes.." by Press, Teukolsky, Vettering, and Flannery; Cambridge University Press
Modified for PIDS time stamp

| Constructor Summary | |
DateTime()
Create a DateTime object with the current date time return DateTime initialized to the current date and time |
|
DateTime(java.util.Calendar inCalendar)
Create a DateTime object from a Calendar object |
|
DateTime(int julian)
Create a DateTime object with the requested julian date |
|
DateTime(int yr,
int mo,
int da)
Create a DateTime object with the requested values, 0 for rest |
|
DateTime(int yr,
int mo,
int da,
int hr,
int mn,
int sc)
Create a DateTime object with the requested values |
|
| Method Summary | |
void |
advance(int n)
Deprecated. Replaced by advanceDays |
void |
advanceDays(int n)
Advances this DateTime by n days |
void |
advanceHours(int hr)
Advances this DateTime by hr hours |
void |
advanceMins(int min)
Advances this DateTime by min minutes |
void |
advanceSecs(int sec)
Advances this DateTime by min minutes |
java.lang.Object |
clone()
|
int |
daysBetween(gov.lanl.Utility.DateTime other)
positive if this is later than the parameter |
void |
fromJulian(double injulian)
Converts a TeleMed julian (both date & time) to a DateTime The DataTime object exists and its values are changed |
void |
fromPIDTime(long thepidtime)
Converts from PID time to the DateTime class |
int |
getDay()
|
int |
getHour()
|
int |
getMin()
|
int |
getMonth()
|
int |
getSecs()
|
int |
getYear()
|
boolean |
isValid()
|
java.util.Calendar |
makeGMTCalendar()
Creates a calendar object using GMT timezone |
java.util.Calendar |
makeLocalCalendar()
Creates a calendar object using Local timezone |
double |
toJulian()
|
long |
toPIDTime()
Converts the DateTime to PID time |
int |
weekday()
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DateTime()
public DateTime(int yr,
int mo,
int da,
int hr,
int mn,
int sc)
java.lang.IllegalArgumentException - if something wrong in dateyr - year (full year, e.g., 1997)mo - month ( 1-12)da - date (1-31)hr - hour of day (0-23)mn - minute of hour (0-59)sc - second of minute (0-59)
public DateTime(int yr,
int mo,
int da)
java.lang.IllegalArgumentException - if something wrong in dateyr - year (full year, e.g., 1997)mo - month ( 1-12)da - date (1-31)public DateTime(java.util.Calendar inCalendar)
inCalendar - is the incomming calendar objectpublic DateTime(int julian)
java.lang.IllegalArgumentException - if something wrongjulian - the date time in our julian expanded format, i.e. date/time| Method Detail |
public void advance(int n)
n - the number of days by which to change this day, + or -public void advanceDays(int n)
n - the number of days by which to change this day, + or -public void advanceHours(int hr)
hr - is the number of hours to addpublic void advanceMins(int min)
min - is the number of minutes to addpublic void advanceSecs(int sec)
sec - is the number of minutes to addpublic int getDay()
public int getMonth()
public int getYear()
public int getHour()
public int getMin()
public int getSecs()
public int weekday()
public int daysBetween(gov.lanl.Utility.DateTime other)
other - any date
public java.lang.Object clone()
clone in class java.lang.Objectpublic boolean isValid()
public double toJulian()
2440000 was 5/23/68 a Thursday
public void fromJulian(double injulian)
injulian - the TeleMed julian daytime numberpublic void fromPIDTime(long thepidtime)
thepidtime - the pid time as a long, has both date and timepublic long toPIDTime()
public java.util.Calendar makeGMTCalendar()
public java.util.Calendar makeLocalCalendar()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||