Home : General : Databases and SQL :

General: Databases and SQL: Re: [Ian] Date and Time fields Questions: Edit Log

Here is the list of edits for this post
Re: [Ian] Date and Time fields Questions
The simplest formatting can be done with localtime.

print scalar localtime;

This takes epoch time as an argument but uses time by default so it is the same as:

print scalar localtime(time());

So you can do like:

print scalar localtime($epoch);

My favorite module for manipulating times/dates is POSIX.

http://www.opengroup.org/...99/xsh/strftime.html

eg..

Code:
use POSIX qw/strftime/;
print POSIX::strftime("%H:%M:%S", localtime);

Last edited by:

Paul: Jun 2, 2002, 3:53 PM

Edit Log: