Re: how to convert a timestamp to MJD (Modified Julian Date)
by Joost (Canon) on Sep 23, 2007 at 23:25 UTC
|
| [reply] |
Re: how to convert a timestamp to MJD (Modified Julian Date)
by talexb (Chancellor) on Sep 24, 2007 at 00:56 UTC
|
In case you didn't get the hint, it's strongly recommended that you search for what you're looking for, before posting a node asking a question.
We're much more likely to help when a query describes the problem, and which searches have come up dry -- or advice on which approach (as the result of your search) might be the best (for some definition of 'best').
Alex / talexb / Toronto
"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds
| [reply] |
Re: how to convert a timestamp to MJD (Modified Julian Date)
by apl (Monsignor) on Sep 24, 2007 at 10:01 UTC
|
In addition to what talexb said, it'd help if you defined what timestamp means to you. I have three users who'd define it three different ways... | [reply] |
Re: how to convert a timestamp to MJD (Modified Julian Date)
by Joost (Canon) on Sep 25, 2007 at 20:43 UTC
|
It's common practice on this site to make any significant edits to your node clear (for instance, by starting new paragraphs with "update:" or striking out outdated lines. That way you won't make the people who replied to the first version of the post look like idiots :-)
Anyway, since you seem to want to convert standard Unix time - seconds since 0:00 1/1/1970 - to MJD - fractional number of days since 0:00 November 17, 1858 - correct me if I'm wrong here - try this:
#!/usr/bin/perl -w
use strict;
use DateTime::Format::Epoch::MJD;
use DateTime::Format::Epoch::Unix;
print DateTime::Format::Epoch::MJD->format_datetime( DateTime::Format:
+:Epoch::Unix->parse_datetime( time ) );
Note that the time function returns the current unix date on all systems I know of except Mac OS classic.
| [reply] [d/l] |
Re: how to convert a timestamp to MJD (Modified Julian Date)
by Anonymous Monk on Sep 25, 2007 at 19:49 UTC
|
Yes, it would have been better to be more specific with the question, including an example. But that does not excuse the rudeness of the replies. Obviously the module was located, but upon casually reviewing the inadequate documentation, I would have the same question. | [reply] |
|
|
now that I'm logged in, I will claim this comment as mine!
| [reply] |
|
|
Now that you're logged in, I'll reply here so you'll get a notification of my reply :-)
that does not excuse the rudeness of the replies. Obviously the module was located, but upon casually reviewing the inadequate documentation, I would have the same question.
1. I wasn't being rude, I posted a link to an obvious first module to try when solving the problem.
2. It wasn't at all obvious the module was located - that information was added later. If the original poster already tried the module and/or couldn't get it to do what he wanted he should have said so, preferably with some specific pointers/questions about why it didn't work.
See also How do I post a question effectively?
Update: removed some irrelevant stuff when I saw the OP was edited.
| [reply] |
|
|
|
|
|