[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



# <a  rel="nofollow" href="http://search.cpan.org/~msergeant/Time-Piece-1.08/Piece.pm";>http://search.cpan.org/~msergeant/Time-Piece-1.08/Piece.pm</a>
use Time::Piece;

$date_string = some_sql_retriever_method();

$date_object = Time::Piece-&gt;strptime($date_string,
    &quot;%Y-%m-%d %H:%M:%S&quot;);

$epoch = $date_object-&gt;epoch;

$new_epoch = $epoch + 1000;

$new_date_object = Time::Piece-&gt;new($new_epoch);

$new_date_string = $new_date_object-&gt;date . &quot; &quot; . $new_date_object-&gt;time;

__END__

See also the note about ISO 8601 date/time strings being
&quot;YYYY-MM-DDThh:mm:ss&quot; where T is a literal T.

Ping me for more info if you need it.

-- 
michael d. ivey        [McQ] : &quot;Wonder, rather than doubt, is the
   &lt;ivey at gweezlebur.com&gt;     : root of knowledge.&quot;
<a  rel="nofollow" href="http://gweezlebur.com/~ivey/";>http://gweezlebur.com/~ivey/</a> :                       -- Abraham Heschel
 encrypted email preferred   :


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="01168" href="msg01168.html">[ale] PERL + SQL Dates</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg01172.html">[ale] snmptrapsd reporting, um, er - flawed logic</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg01174.html">[ale] (OT) data recovery - show and tell?</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg01171.html">[ale] PERL + SQL Dates</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg01178.html">[ale] PERL + SQL Dates</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#01173"><strong>Date</strong></a></li>
<li><a href="threads.html#01173"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>