Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Could you explain what do you mean by "get epoch time"

This is what I meant.

# create a DateTime object from an ISO timestring my $isostr = '2021-10-09T11:13:57'; # jd 2459496.96802 my $dt = DateTime::Format::ISO8601->parse_datetime($isostr); my @phases = phasehunt($dt->epoch); $logger->info("@phases"); my $start_epoch = $phases[0]; my $end_epoch = $phases[4]; my $diff = $end_epoch - $start_epoch; my $hard_bottom = int($start_epoch); $logger->info("integer bottom is $hard_bottom");

Output:

2021/10/14 13:49:52 INFO 1633518344.15928 1634095655.87543 1634741861. +07993 1635451604.37235 1636060526.50686 2021/10/14 13:49:52 INFO integer bottom is 1633518344

Anything numerical happens over an interval, and paying special attention to the bounds has a profound bearing on whether results are valid. I like to bound an interval with lub and glb integers to check results with familiar tools.

Thanks for your comments, I'm trying to get this written before before the interval has elapsed....


In reply to Re^2: iterating over time with DateTime to obtain values with Astro::Coords by Aldebaran
in thread iterating over time with DateTime to obtain values with Astro::Coords by Aldebaran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2023-02-03 23:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (30 votes). Check out past polls.

    Notices?