[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Tue Apr 27 09:33:08 2004 -->
- <!--x-from-r13: virl ng tjrrmyrohe.pbz (zvpunry q. virl) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: 1083070211.17414.55.camel@devel --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] PERL + SQL Dates -->
- <li><em>date</em>: Tue Apr 27 09:33:08 2004</li>
- <li><em>from</em>: ivey at gweezlebur.com (michael d. ivey)</li>
- <li><em>in-reply-to</em>: <1083070211.17414.55.camel@devel></li>
- <li><em>references</em>: <1083070211.17414.55.camel@devel></li>
- <li><em>subject</em>: [ale] PERL + SQL Dates</li>
# <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->strptime($date_string,
"%Y-%m-%d %H:%M:%S");
$epoch = $date_object->epoch;
$new_epoch = $epoch + 1000;
$new_date_object = Time::Piece->new($new_epoch);
$new_date_string = $new_date_object->date . " " . $new_date_object->time;
__END__
See also the note about ISO 8601 date/time strings being
"YYYY-MM-DDThh:mm:ss" where T is a literal T.
Ping me for more info if you need it.
--
michael d. ivey [McQ] : "Wonder, rather than doubt, is the
<ivey at gweezlebur.com> : root of knowledge."
<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>