in reply to Re^2: Convert dates with Time::Local
in thread Convert dates with Time::Local

I don't think I'd use timegm with a Julian date.

Jan 1st 1970 has a Julian date of 2440587. Surely you can just subtract that from the Julian date you have and then multiply by the number of seconds in a day to get the number of seconds since the epoch. This, of course, assumes that your computer uses 1970-01-01 00:00:00 as its epoch.

--
<http://dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Replies are listed 'Best First'.
Re^4: Convert dates with Time::Local
by duff (Parson) on Feb 13, 2006 at 16:47 UTC

    Julian dates and julian days are different things. The latter is just the number of days since the start of the year. Jan 1 is julian day 1, Feb 1 is julian day 32, Feb 2, day 33, and so on.

      Julian days and Julian dates are subtley different things as the Wikipedia article indicates. But Julian day doesn't mean what you think it means. Granted, it's quite a common error. But it's still an error :)

      --
      <http://dave.org.uk>

      "The first rule of Perl club is you do not talk about Perl club."
      -- Chip Salzenberg

        Julian day doesn't mean what you think it means

        Sure it does. You don't think wikipedia the authoritative source of all knowledge do you? There's not a one-to-one correspondence between names and concepts. Sometimes a name is used for multiple (sometimes incompatible or even unrelated) concepts. This is one of those times.

        In any case, I'm fairly sure that jeanluca and I are talking about the same thing :)