swisseph
Class SweDate

java.lang.Object
  extended by swisseph.SweDate
All Implemented Interfaces:
java.io.Serializable

public class SweDate
extends java.lang.Object
implements java.io.Serializable

This class is a date class specialized for the use with the swisseph package. You will like to use it, if you need a Julian Day number or the deltaT for a date or a Julian Day or if like to convert from Gregorian to Julian calendar system or vice versa.

This is a port of the SwissEphemeris package to Java. See Astrodienst Zürich for more infos and the original authors.

You will find the complete documentation for the original SwissEphemeris package at http://www.astro.ch/swisseph/sweph_g.htm. By far most of the information there is directly valid for this port to Java as well.

See Also:
Serialized Form

Field Summary
static int FRIDAY
          Constant for weekdays.
 boolean init_leapseconds_done
           
static double JD0
          The Julian day number of 1970 January 1.0.
static int MONDAY
          Constant for weekdays.
static int SATURDAY
          Constant for weekdays.
static boolean SE_GREG_CAL
           
static boolean SE_JUL_CAL
           
static boolean SE_KEEP_DATE
           
static boolean SE_KEEP_JD
           
static double SE_TIDAL_26
          Tidal acceleration value in the mean motion of the moon of -26.
static double SE_TIDAL_DE200
          Tidal acceleration value in the mean motion of the moon of DE200 (-23.8946).
static double SE_TIDAL_DE403
          Tidal acceleration value in the mean motion of the moon of DE403 (-25.8).
static double SE_TIDAL_DE404
          Tidal acceleration value in the mean motion of the moon of DE404 (-25.8).
static double SE_TIDAL_DE405
          Tidal acceleration value in the mean motion of the moon of DE405 (-25.7376).
static double SE_TIDAL_DE406
          Tidal acceleration value in the mean motion of the moon of DE406 (-25.7376).
static double SE_TIDAL_DEFAULT
          Default tidal acceleration value in the mean motion of the moon (=SE_TIDAL_DE406).
static int SUNDAY
          Constant for weekdays.
static int THURSDAY
          Constant for weekdays.
static int TUESDAY
          Constant for weekdays.
static int WEDNESDAY
          Constant for weekdays.
 
Constructor Summary
SweDate()
          This constructs a new SweDate with a default of the current date and current time at GMT.
SweDate(double jd)
          This constructs a new SweDate with the given Julian Day number.
SweDate(double jd, boolean calType)
          This constructs a new SweDate with the given Julian Day number.
SweDate(int year, int month, int day, double hour)
          This constructs a new SweDate with the given date and time.
SweDate(int year, int month, int day, double hour, boolean calType)
          This constructs a new SweDate with the given date and time.
 
Method Summary
 boolean checkDate()
          Checks the date to see, if it is a valid date.
 boolean checkDate(int year, int month, int day)
          Checks the given date to see, if it is a valid date.
 boolean checkDate(int year, int month, int day, double hour)
          Checks the given date to see, if it is a valid date.
 boolean getCalendarType()
          Queries the type of calendar in effect - Gregorian or Julian calendar.
static java.util.Date getDate(double jd)
          This will return a java.util.Date object from a julian day number.
 java.util.Date getDate(long offset)
          This will return a java.util.Date object with the date of this SweDate object.
 int getDay()
          Queries the day of this SweDate object.
 int getDayOfWeekNr()
          Queries the day of the week, i.e.
static int getDayOfWeekNr(double jd)
          Queries the day of the week of the given Julian Day number (interpreted in the gregorian calendar system!).
static int getDayOfWeekNr(int year, int month, int day)
          Queries the day of the week of the given date that is interpreted as being a date in the Gregorian or Julian calendar system depending on the date, the switch from Julian to Gregorian calendar system occured.
static int getDayOfWeekNr(int year, int month, int day, boolean calType)
          Queries the day of the week of the given date that is interpreted as being a date in the given calendar system.
 double getDeltaT()
          Queries the delta T value for the date of this object.
static double getDeltaT(double tjd)
          Queries the delta T value for the given Julian Day number - this is a static method.
 double getGregorianChange()
          Returns the julian day number on which the Gregorian calendar system comes to be in effect.
 double getHour()
          Queries the hour of the day of this SweDate object.
 java.lang.String getInvalidUTCDateError(int iyear, int imonth, int iday, int ihour, int imin, double dsec, boolean gregflag)
          Returns a String error message, if the year, month, day, hour, minute and second fields do not describe a valid date.
 double[] getJDfromUTC(int iyear, int imonth, int iday, int ihour, int imin, double dsec, boolean gregflag, boolean checkValidInput)
          Calculates the julian day numbers (TT (==ET) and UT1) from a given date.
 double getJulDay()
          Queries the Julian Day number of this object.
static double getJulDay(int year, int month, int day, double hour)
          Queries the Julian Day number of the given date in Gregorian calendar system - this is a static method.
static double getJulDay(int year, int month, int day, double hour, boolean calType)
          Queries the Julian Day number of the given date that is interpreted as a date in the given calendar system - this is a static method.
 int getMonth()
          Queries the month of this SweDate object.
 double getTidalAcc()
          Returns the tidal acceleration used in calculations of delta T.
 SDate getUTCfromJDET(double tjd_et, boolean gregflag)
          Calculates the UTC date from ET Julian day number.
 SDate getUTCfromJDUT1(double tjd_ut, boolean gregflag)
          Calculates the UTC date from UT1 (universal time) Julian day number.
 int getYear()
          Queries the year of this SweDate object.
 boolean isValidUTCDate(int iyear, int imonth, int iday, int ihour, int imin, double dsec, boolean gregflag)
          Determines, if the year, month, day, hour, minute and second fields describe a valid date.
 void makeValidDate()
          Makes the date to be a valid date.
 void setCalendarType(boolean newCalType, boolean keepDate)
          Sets the calendar type for this object.
 boolean setDate(int newYear, int newMonth, int newDay, double newHour)
          Sets a new date for this object.
 boolean setDate(int newYear, int newMonth, int newDay, double newHour, boolean check)
          Sets a new date for this object.
 boolean setDay(int newDay)
          Sets the day-part of the date.
 boolean setDay(int newDay, boolean check)
          Sets the day-part of the date.
 void setGregorianChange(double newJDCO)
          Changes the date of the start of the Gregorian calendar system.
 void setGregorianChange(int year, int month, int day)
          Changes the date of the start of the Gregorian calendar system.
 boolean setHour(double newHour)
          Sets a new hour.
 void setJulDay(double newJD)
          Sets the new Julian Day for this object.
 boolean setMonth(int newMonth)
          Sets the month-part of the date.
 boolean setMonth(int newMonth, boolean check)
          Sets the year-part of the date.
 void setTidalAcc(double tid_acc)
          Sets the tidal acceleration used in calculations of delta T.
 boolean setYear(int newYear)
          Sets the year-part of the date.
 boolean setYear(int newYear, boolean check)
          Sets the year-part of the date.
 java.lang.String toString()
          Returns the date, calendar type (gregorian / julian), julian day number and the deltaT value of this object.
 void updateCalendarType()
          Update the calendar type according to the Gregorian calendar start date and the date of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SUNDAY

public static final int SUNDAY
Constant for weekdays. SUNDAY is equal to 0.

See Also:
Constant Field Values

MONDAY

public static final int MONDAY
Constant for weekdays. MONDAY is equal to 1.

See Also:
Constant Field Values

TUESDAY

public static final int TUESDAY
Constant for weekdays. TUESDAY is equal to 2.

See Also:
Constant Field Values

WEDNESDAY

public static final int WEDNESDAY
Constant for weekdays. WEDNESDAY is equal to 3.

See Also:
Constant Field Values

THURSDAY

public static final int THURSDAY
Constant for weekdays. THURSDAY is equal to 4.

See Also:
Constant Field Values

FRIDAY

public static final int FRIDAY
Constant for weekdays. FRIDAY is equal to 5.

See Also:
Constant Field Values

SATURDAY

public static final int SATURDAY
Constant for weekdays. SATURDAY is equal to 6.

See Also:
Constant Field Values

SE_JUL_CAL

public static final boolean SE_JUL_CAL
See Also:
Constant Field Values

SE_GREG_CAL

public static final boolean SE_GREG_CAL
See Also:
Constant Field Values

SE_KEEP_DATE

public static final boolean SE_KEEP_DATE
See Also:
Constant Field Values

SE_KEEP_JD

public static final boolean SE_KEEP_JD
See Also:
Constant Field Values

init_leapseconds_done

public boolean init_leapseconds_done

SE_TIDAL_DE403

public static final double SE_TIDAL_DE403
Tidal acceleration value in the mean motion of the moon of DE403 (-25.8).

See Also:
Constant Field Values

SE_TIDAL_DE404

public static final double SE_TIDAL_DE404
Tidal acceleration value in the mean motion of the moon of DE404 (-25.8).

See Also:
Constant Field Values

SE_TIDAL_DE405

public static final double SE_TIDAL_DE405
Tidal acceleration value in the mean motion of the moon of DE405 (-25.7376).

See Also:
Constant Field Values

SE_TIDAL_DE406

public static final double SE_TIDAL_DE406
Tidal acceleration value in the mean motion of the moon of DE406 (-25.7376).

See Also:
Constant Field Values

SE_TIDAL_DE200

public static final double SE_TIDAL_DE200
Tidal acceleration value in the mean motion of the moon of DE200 (-23.8946).

See Also:
Constant Field Values

SE_TIDAL_26

public static final double SE_TIDAL_26
Tidal acceleration value in the mean motion of the moon of -26.

See Also:
Constant Field Values

SE_TIDAL_DEFAULT

public static final double SE_TIDAL_DEFAULT
Default tidal acceleration value in the mean motion of the moon (=SE_TIDAL_DE406).

See Also:
SE_TIDAL_DE406, Constant Field Values

JD0

public static final double JD0
The Julian day number of 1970 January 1.0. Useful for conversions from or to a Date object.

See Also:
getDate(long), Constant Field Values
Constructor Detail

SweDate

public SweDate()
This constructs a new SweDate with a default of the current date and current time at GMT.


SweDate

public SweDate(double jd)
This constructs a new SweDate with the given Julian Day number. The calendar system will be Gregorian after October 15, 1582 or Julian before that date.

Parameters:
jd - Julian Day number

SweDate

public SweDate(double jd,
               boolean calType)
This constructs a new SweDate with the given Julian Day number. The dates will be calculated according to the given calendar system (Gregorian or Julian calendar).

Parameters:
jd - Julian Day number
calType - calendar type (Gregorian or Julian calendar system)
See Also:
SE_GREG_CAL, SE_JUL_CAL

SweDate

public SweDate(int year,
               int month,
               int day,
               double hour)
This constructs a new SweDate with the given date and time. The calendar type is automatically adjusted to Julian calendar system before October 15, 1582, and to Gregorian calendar system after and including that date. The dates from October 5 to October 14, 1582 had been skipped during the conversion to the Gregorian calendar, so we just convert any such date to Julian calendar system even though no such date did exist.

Parameters:
year - The year of the date
month - The month of the date
day - The day-number in a month of that date
hour - The hour of the day

SweDate

public SweDate(int year,
               int month,
               int day,
               double hour,
               boolean calType)
This constructs a new SweDate with the given date and time. The date numbers will be interpreted according to the given calendar system (Gregorian or Julian calendar).

Parameters:
year - The year of the date
month - The month of the date
day - The day-number of the date
hour - The hour of the day
calType - calendar type (Gregorian or Julian calendar system)
See Also:
SE_GREG_CAL, SE_JUL_CAL
Method Detail

getJulDay

public double getJulDay()
Queries the Julian Day number of this object.

Returns:
Julian Day number

getJulDay

public static double getJulDay(int year,
                               int month,
                               int day,
                               double hour)
Queries the Julian Day number of the given date in Gregorian calendar system - this is a static method.

Parameters:
year - The year of the date
month - The month of the date
day - The day-number of the date
hour - The hour of the day
Returns:
Julian Day number

getJulDay

public static double getJulDay(int year,
                               int month,
                               int day,
                               double hour,
                               boolean calType)
Queries the Julian Day number of the given date that is interpreted as a date in the given calendar system - this is a static method.

Parameters:
year - The year of the date
month - The month of the date
day - The day-number of the date
hour - The hour of the day
calType - calendar type (Gregorian or Julian calendar system)
Returns:
Julian Day number
See Also:
SE_GREG_CAL, SE_JUL_CAL

getDayOfWeekNr

public int getDayOfWeekNr()
Queries the day of the week, i.e. Sunday to Saturday as represented by an integer. Sunday is represented by 0, Saturday by 6. Any discontinuity in the sequence of weekdays is not taken into account! Attention: the numbers are different from the numbers returned by the java.awt.Calendar class!

Returns:
Number of the day of week
See Also:
SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY

getDayOfWeekNr

public static int getDayOfWeekNr(double jd)
Queries the day of the week of the given Julian Day number (interpreted in the gregorian calendar system!). Sunday is represented by 0, Saturday by 6. Any discontinuity in the sequence of weekdays is not taken into account! Attention: the numbers are different from the numbers returned by the java.awt.Calendar class!

Parameters:
jd - The Julian Day number of the date
Returns:
Number of the day of week
See Also:
SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY

getDayOfWeekNr

public static int getDayOfWeekNr(int year,
                                 int month,
                                 int day)
Queries the day of the week of the given date that is interpreted as being a date in the Gregorian or Julian calendar system depending on the date, the switch from Julian to Gregorian calendar system occured. Sunday is represented by 0, Saturday by 6. Any discontinuity in the sequence of weekdays is not taken into account! Attention: the numbers are different from the numbers returned by the java.awt.Calendar class!

Parameters:
year - The year of the date
month - The month of the date
day - The day-number of the date
Returns:
Number of the day of week
See Also:
SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY

getDayOfWeekNr

public static int getDayOfWeekNr(int year,
                                 int month,
                                 int day,
                                 boolean calType)
Queries the day of the week of the given date that is interpreted as being a date in the given calendar system. Sunday is represented by 0, Saturday by 6. Any discontinuity in the sequence of weekdays is not taken into account! Attention: the numbers are different from the numbers returned by the java.awt.Calendar class!

Parameters:
year - The year of the date
month - The month of the date
day - The day-number of the date
calType - calendar type (Gregorian or Julian calendar system)
Returns:
Number of the day of week
See Also:
SE_GREG_CAL, SE_JUL_CAL, SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY

getCalendarType

public boolean getCalendarType()
Queries the type of calendar in effect - Gregorian or Julian calendar. This will effect what date you will get back for a given Julian Day.

Returns:
Calendar type
See Also:
SE_GREG_CAL, SE_JUL_CAL

getYear

public int getYear()
Queries the year of this SweDate object.

Returns:
year

getMonth

public int getMonth()
Queries the month of this SweDate object.

Returns:
month Attention: The month ranges from 1 to 12, this is different to the java.util.Calendar class!

getDay

public int getDay()
Queries the day of this SweDate object.

Returns:
day number

getHour

public double getHour()
Queries the hour of the day of this SweDate object.

Returns:
hour

getDeltaT

public double getDeltaT()
Queries the delta T value for the date of this object.

Returns:
delta T

getDeltaT

public static double getDeltaT(double tjd)
Queries the delta T value for the given Julian Day number - this is a static method. Delta T is calculated with a tidal acceleration of SE_TIDAL_DEFAULT.

Parameters:
tjd - Julian Day number
Returns:
delta T
See Also:
SE_TIDAL_DEFAULT

getDate

public java.util.Date getDate(long offset)
This will return a java.util.Date object with the date of this SweDate object. This is needed often in internationalisation of date and time formats. You can add an offset in milliseconds to account for timezones or daylight savings time, as SweDate is meant to be in GMT time always.

Parameters:
offset - An offset in milliseconds to be added to the current date and time.

getDate

public static java.util.Date getDate(double jd)
This will return a java.util.Date object from a julian day number.

Parameters:
jd - The julian day number for which to create a Date object.

setJulDay

public void setJulDay(double newJD)
Sets the new Julian Day for this object. This operation does NOT change the calendar type (Gregorian or Julian calendar). Use methods setCalendarType() or updateCalendarType() for this.

Parameters:
newJD - Julian Day number

setCalendarType

public void setCalendarType(boolean newCalType,
                            boolean keepDate)
Sets the calendar type for this object.

Parameters:
newCalType - Calendar type (Greogorian or Julian calendar)
keepDate - Determines, if the date or the julian day should be fix in this operation.
See Also:
SE_GREG_CAL, SE_JUL_CAL, SE_KEEP_DATE, SE_KEEP_JD

updateCalendarType

public void updateCalendarType()
Update the calendar type according to the Gregorian calendar start date and the date of this object.


setDate

public boolean setDate(int newYear,
                       int newMonth,
                       int newDay,
                       double newHour)
Sets a new date for this object.

Parameters:
newYear - the year-part of the new date
newMonth - the month-part of the new date [1-12]
newDay - the day-part of the new date [1-31]
newHour - the hour of the new date
Returns:
true

setDate

public boolean setDate(int newYear,
                       int newMonth,
                       int newDay,
                       double newHour,
                       boolean check)
Sets a new date for this object. The input can be checked, if it is a valid date and can be modified, if not. See parameter "check".

Parameters:
newYear - the year-part of the new date
newMonth - the month-part of the new date [1-12]
newDay - the day-part of the new date [1-31]
newHour - the hour of the new date
check - if true it returns if the date is valid and converts the the date into a valid date
Returns:
true, if check==false, or if the date is valid. False otherwise

setYear

public boolean setYear(int newYear)
Sets the year-part of the date.

Parameters:
newYear - The new year
Returns:
true

setYear

public boolean setYear(int newYear,
                       boolean check)
Sets the year-part of the date. The input can be checked, if the result is a valid date and can be modified, if not. E.g., the date was 29th of february 2004, and the year gets set to 2001. 2001 does not have a 29th of february, so if parameter check is set to true, it will return false and modify the date to 1st of march 2001.

Parameters:
newYear - The new year
check - check, if the resulting new date is a valid date and adjust the values for day, month or year if necessary
Returns:
true if check==false, or if the date is valid. False otherwise

setMonth

public boolean setMonth(int newMonth)
Sets the month-part of the date.

Parameters:
newMonth - The new month
Returns:
true

setMonth

public boolean setMonth(int newMonth,
                        boolean check)
Sets the year-part of the date. The input can be checked, if the result is a valid date and can be modified, if not.

Parameters:
newMonth - The new year
check - check, if the resulting new date is a valid date and adjust the values for day, month or year if necessary
Returns:
true, if check==true, otherwise return true only, if the date is valid
See Also:
setYear(int, boolean)

setDay

public boolean setDay(int newDay)
Sets the day-part of the date.

Parameters:
newDay - The new day
Returns:
true

setDay

public boolean setDay(int newDay,
                      boolean check)
Sets the day-part of the date. The input can be checked, if the result is a valid date and can be modified, if not.

Parameters:
newDay - The new day
check - check, if the resulting new date is a valid date and adjust the values for day, month or year if necessary
Returns:
true, if check==true, otherwise return true only, if the date is valid
See Also:
setYear(int, boolean)

setHour

public boolean setHour(double newHour)
Sets a new hour.

Parameters:
newHour - The new hour
Returns:
true

checkDate

public boolean checkDate()
Checks the date to see, if it is a valid date.

Returns:
true, if the date is valid, false, if not

checkDate

public boolean checkDate(int year,
                         int month,
                         int day)
Checks the given date to see, if it is a valid date.

Parameters:
year - the year, for which is to be checked
month - the month, for which is to be checked
day - the day, for which is to be checked
Returns:
true, if the date is valid, false, if not

checkDate

public boolean checkDate(int year,
                         int month,
                         int day,
                         double hour)
Checks the given date to see, if it is a valid date.

Parameters:
year - the year, for which is to be checked
month - the month, for which is to be checked
day - the day, for which is to be checked
hour - the hour, for which is to be checked
Returns:
true, if the date is valid, false, if not

makeValidDate

public void makeValidDate()
Makes the date to be a valid date.


getGregorianChange

public double getGregorianChange()
Returns the julian day number on which the Gregorian calendar system comes to be in effect.


setGregorianChange

public void setGregorianChange(int year,
                               int month,
                               int day)
Changes the date of the start of the Gregorian calendar system. This method will keep the date and change the julian day number of the date of this SweDate object if required.

Parameters:
year - The year (in Gregorian system) for the new start date
month - The month (in Gregorian system) for the new start date. Adversely to java.util.Calendar, the month is to be given in the range of 1 for January to 12 for December!
day - The day of the month (in Gregorian system, from 1 to 31) for the new start date

setGregorianChange

public void setGregorianChange(double newJDCO)
Changes the date of the start of the Gregorian calendar system. This method will keep the julian day number and change year, month and day of the date of this SweDate object if required.

Parameters:
newJDCO - The julian day number, on which the Gregorian calendar came into effect.

getTidalAcc

public double getTidalAcc()
Returns the tidal acceleration used in calculations of delta T.

Returns:
Tidal acceleration

setTidalAcc

public void setTidalAcc(double tid_acc)
Sets the tidal acceleration used in calculations of delta T.

Parameters:
tid_acc - tidal acceleration
See Also:
SE_TIDAL_DE403, SE_TIDAL_DE404, SE_TIDAL_DE405, SE_TIDAL_DE406, SE_TIDAL_DE200, SE_TIDAL_26, SE_TIDAL_DEFAULT

toString

public java.lang.String toString()
Returns the date, calendar type (gregorian / julian), julian day number and the deltaT value of this object.

Overrides:
toString in class java.lang.Object
Returns:
Infos about this object

isValidUTCDate

public boolean isValidUTCDate(int iyear,
                              int imonth,
                              int iday,
                              int ihour,
                              int imin,
                              double dsec,
                              boolean gregflag)
Determines, if the year, month, day, hour, minute and second fields describe a valid date.

Parameters:
iyear - Year of the input date (UTC)
imonth - Month of the input date (UTC, 1 to 12)
iday - Day of the input date (UTC, 1 to 31)
ihour - Hour of the input date (UTC, 0 to 23)
imin - Minute of the input date (UTC, 0 to 59)
dsec - Second of the input date (UTC, 1.0 to less than 61.0)
gregflag - true == Gregorian calendar, false == Julian calendar
Returns:
true, if the date is valid, false otherwise.

getInvalidUTCDateError

public java.lang.String getInvalidUTCDateError(int iyear,
                                               int imonth,
                                               int iday,
                                               int ihour,
                                               int imin,
                                               double dsec,
                                               boolean gregflag)
Returns a String error message, if the year, month, day, hour, minute and second fields do not describe a valid date.

Parameters:
iyear - Year of the input date (UTC)
imonth - Month of the input date (UTC, 1 to 12)
iday - Day of the input date (UTC, 1 to 31)
ihour - Hour of the input date (UTC, 0 to 23)
imin - Minute of the input date (UTC, 0 to 59)
dsec - Second of the input date (UTC, 1.0 to less than 61.0)
gregflag - true == Gregorian calendar, false == Julian calendar
Returns:
null, if the date is valid, otherwise it returns a message in english, describing the error field.

getJDfromUTC

public double[] getJDfromUTC(int iyear,
                             int imonth,
                             int iday,
                             int ihour,
                             int imin,
                             double dsec,
                             boolean gregflag,
                             boolean checkValidInput)
                      throws SwissephException
Calculates the julian day numbers (TT (==ET) and UT1) from a given date.

Parameters:
iyear - Year of the input date (UTC)
imonth - Month of the input date (UTC, 1 to 12)
iday - Day of the input date (UTC, 1 to 31)
ihour - Hour of the input date (UTC, 0 to 23)
imin - Minute of the input date (UTC, 0 to 59)
dsec - Second of the input date (UTC, 1.0 to less than 61.0)
gregflag - true == Gregorian calendar, false == Julian calendar
checkValidInput - if true, throws SwissephException, when any of month, day, hour, minute or second are out of their valid ranges. If false, it doesn't care about invalid values (e.g. month = 13 or second = 61, even though there is no leap second on that date and time).
Returns:
an array of two doubles
first value = Julian day number TT (ET)
second value = Julian day number UT1

Note:

 - Before 1972, swe_utc_to_jd() treats its input time as UT1.
   Note: UTC was introduced in 1961. From 1961 - 1971, the length of the
   UTC second was regularly changed, so that UTC remained very close to UT1.
 - From 1972 on, input time is treated as UTC.
 - If delta_t - nleap - 32.184 > 1, the input time is treated as UT1.
   Note: Like this we avoid errors greater than 1 second in case that
   the leap seconds table (or the Swiss Ephemeris version) is not updated
   for a long time.
Throws:
SwissephException
See Also:
getUTCfromJDET(double, boolean), getUTCfromJDUT1(double, boolean), SE_GREG_CAL, SE_JUL_CAL

getUTCfromJDET

public SDate getUTCfromJDET(double tjd_et,
                            boolean gregflag)
Calculates the UTC date from ET Julian day number.

Parameters:
tjd_et - Julian day number (ET) to be converted.
gregflag - true == Gregorian calendar, false == Julian calendar
Returns:
The UTC date as SDate object. Note:
 - Before 1 jan 1972 UTC, output UT1.
   Note: UTC was introduced in 1961. From 1961 - 1971, the length of the
   UTC second was regularly changed, so that UTC remained very close to UT1.
 - From 1972 on, output is UTC.
 - If delta_t - nleap - 32.184 > 1, the output is UT1.
   Note: Like this we avoid errors greater than 1 second in case that
   the leap seconds table (or the Swiss Ephemeris version) has not been
   updated for a long time.
See Also:
getUTCfromJDUT1(double, boolean), SDate, SE_GREG_CAL, SE_JUL_CAL

getUTCfromJDUT1

public SDate getUTCfromJDUT1(double tjd_ut,
                             boolean gregflag)
Calculates the UTC date from UT1 (universal time) Julian day number.

Parameters:
tjd_ut - Julian day number (UT1) to be converted.
gregflag - true == Gregorian calendar, false == Julian calendar
Returns:
The UTC date as SDate object. Note:
 - Before 1 jan 1972 UTC, output UT1.
   Note: UTC was introduced in 1961. From 1961 - 1971, the length of the
   UTC second was regularly changed, so that UTC remained very close to UT1.
 - From 1972 on, output is UTC.
 - If delta_t - nleap - 32.184 > 1, the output is UT1.
   Note: Like this we avoid errors greater than 1 second in case that
   the leap seconds table (or the Swiss Ephemeris version) has not been
   updated for a long time.
See Also:
getUTCfromJDET(double, boolean), SDate, SE_GREG_CAL, SE_JUL_CAL