in reply to How to convert time in perl?
$ perl -e 'print time()' gives 1054817016, for example. To get a string representation of that, use localtime:
$ perl -e '$timestr = localtime(time()); print $timestr'
For See also the documentation on the time() and localtime() functions. Using the localtime function in list context gives you the different time parts (seconds, minutes, hours, etc.) which you can format with printf or sprintf to get the format you want. See the documentation for examples.
Arjen
|
|---|