Learn and Learn

Learn And Learn - great place for tutorials, references and how-to

Ruby – Find Astronomical Julian Day – ajd Method with Examples

ajd method is used to return the astronomical Julian day number. This method produced the fractional number, which is not properly adjusted by the offset. ajd is a part of Date Library in Ruby.

Syntax of ajd Method in Ruby

The syntax of ajd method in Ruby Language is:

 

Parameters of ajd Method in Ruby

x – Where x is any date which is required to be converted into an Astronomical Julian day number. This parameter is required.

 

Error Handling

If the x parameter is not a valid calander date the ajd method returns an error. ajd method generates a new julian day number by indicating from a calander date given in a code.

 

Return Value of ajd method in Ruby

ajd method will return Astronomical Julian Day number from a valid date given in a code.

 

Use of ajd method / function in Ruby


Output:
4914843/2

Convert Date into Astronomical Julian Day Number in Ruby


Output:
4914857/2

ajd method / function explained


Output:
4914441/2

Loading...
LearnAndLearn.com © 2018 - All rights reserved