|
mhuss utils 1.1.5ws | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mhuss.AstroLib.AstroDate
public class AstroDate
A support class for DateOps.
This class stores a date/time value at a precision of one second. This date/time can be specified using either the Gregorian Calendar (by default) or the Julian Calendar.
It also supports conversions to and from the Julian Day number.
Constructor Summary | |
---|---|
AstroDate()
Default constructor = epoch J2000 (noon on 1/1/2000) |
|
AstroDate(double jd)
Julian Day constructor. |
|
AstroDate(int day,
int month,
int year)
Day, Month, Year constructor (time defaults to 00:00:00 = midnight) |
|
AstroDate(int day,
int month,
int year,
double dayFraction)
Day, Month, Year + fraction of a day constructor |
|
AstroDate(int day,
int month,
int year,
int seconds)
Literal (member by member) constructor |
|
AstroDate(int day,
int month,
int year,
int hour,
int min,
int sec)
Explicit day, month, year, hour, minute, and second constructor |
Method Summary | |
---|---|
int |
day()
Get the day. |
int |
hour()
Get the Hour. |
int |
hourRound()
Get the rounded hour. |
double |
jd()
Convert this instance of AstroDate to a Julian Day. |
static double |
jd(AstroDate ad)
Convert an AstroDate to a Julian Day. |
static double |
jd(AstroDate ad,
boolean julian)
Convert an AstroDate to a Julian Day. |
double |
jd(boolean julian)
Convert this instance of AstroDate to a Julian Day. |
static void |
main(java.lang.String[] args)
(for unit testing only) |
int |
minute()
Get the minute. |
int |
minuteRound()
Get the rounded minute. |
int |
month()
Get the month. |
int |
second()
Get the second. |
java.util.GregorianCalendar |
toGCalendar()
Convert this AstroDate instance to a GregorianCalendar. |
java.lang.String |
toMinString()
Convert this AstroDate instance to a String, formatted to the minute. |
java.lang.String |
toMinStringTZ()
Convert this AstroDate instance to a String formatted to the minute, with Time Zone indicator. |
java.lang.String |
toString()
Convert this AstroDate instance to a String. |
java.lang.String |
toStringTZ()
Convert this AstroDate instance to a String, with Time Zone indicator. |
int |
year()
Get the year. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AstroDate()
public AstroDate(int day, int month, int year, int seconds)
day
- Day of the month (1...31)month
- Month of the year (1..12)year
- Yearseconds
- Time in seconds past midnight. This must be in the
range from 0 to Astro.SECONDS_PER_DAY-1.public AstroDate(int day, int month, int year, int hour, int min, int sec)
day
- Day of the month (1...31)month
- Month of the year (1..12)year
- Yearhour
- Hour of the day (0...23)min
- Minute of the hour (0...59)sec
- Second of the minute (0...59)public AstroDate(int day, int month, int year)
day
- Day of the month (1...31)month
- Month of the year (1..12)year
- Yearpublic AstroDate(int day, int month, int year, double dayFraction)
day
- Day of the monthmonth
- Month of the yearyear
- YeardayFraction
- Fraction of the daypublic AstroDate(double jd)
jd
- Julian day numberMethod Detail |
---|
public static double jd(AstroDate ad, boolean julian)
ad
- The date to convertjulian
- true = Julian calendar, else Gregorian
public static double jd(AstroDate ad)
ad
- The date to convert
public double jd(boolean julian)
julian
- true = Julian calendar, else Gregorian
public double jd()
public int year()
public int month()
public int day()
public int hour()
public int hourRound()
public int minute()
public int minuteRound()
public int second()
public java.util.GregorianCalendar toGCalendar()
public java.lang.String toMinString()
The format of the returned string is YYYY-MM-DD hh:mm.
public java.lang.String toMinStringTZ()
The format of the returned string is YYYY-MM-DD hh:mm TZ, where TZ is a locale-specific timezone name (e.g., "EST").
public java.lang.String toString()
The format of the returned string is YYYY-MM-DD hh:mm:ss.
toString
in class java.lang.Object
public java.lang.String toStringTZ()
The format of the returned string is YYYY-MM-DD hh:mm:ss TZ, where TZ is a locale-specific timezone name (e.g., "EST")
public static void main(java.lang.String[] args)
|
mhuss utils 1.1.5ws | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |