How do I convert an int to a date?

I have an int (which is actually a Julian Day Number value) which I
want to convert to an actual date value. How do i do this?

..to_date() does not do what I want, but there must be something like
this. I'm just not sure what to look for.

dlehman@gmail.com wrote:

I have an int (which is actually a Julian Day Number value) which I
want to convert to an actual date value. How do i do this?

..to_date() does not do what I want, but there must be something like
this. I'm just not sure what to look for.

Is the class method Date::jd what you're looking for? It takes a Julian Day Number and returns a Date object. It has an optional parameter for the Day of Calendar Reform (defaults to Date::ITALY, but you can also use Date::England). Once you have the Date object, you can use its methods to convert to any shape you want :slight_smile: .

You should check the Date methods at http://www.ruby-doc.org/core/ . I'm pretty sure you'll find there exactly what you need.

ยทยทยท

--
Christophe Grandsire.

http://rainbow.conlang.free.fr

You need a straight mind to invent a twisted conlang.

Great-- exactly what I needed. Thanks for the lead in the right
direction.