Re: Date::Manip

[email protected]
Newsgroups perl.beginners
Organization Still searching...
Message-ID <[email protected]>
Rob Dixon <[email protected]> writes:

>> What is the right syntax?
>
>   print $date = ParseDate("epoch 1210628919") . "\n";

Egad, and there is a big NOTE in perldoc Date::Manip about that very
thing... thanks for you patience

For anyone finding these posts with  a search:
 (From perldoc Date::Manip)

           NOTE:  One of the most frequently asked questions that I
           have gotten is how to parse seconds since the epoch.
           ParseDateString
           cannot simply parse a number as the seconds since the epoch
           (it conflicts with some ISO-8601 date formats).  There are
           two ways
           to get this information.  First, you can do the following:

               $secs = ...         # seconds since Jan 1, 1970
               00:00:00 GMT
               $date = DateCalc("Jan 1, 1970  00:00:00 GMT","+
               $secs");

           Second, you can call it directly as:

               $date = ParseDateString("epoch $secs");
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.