Is it possible by console command to translate a number given as number (eg:1148581788) human redable format eg: Sat May 27 01:13:23 EEST 2006
Or should I write a program as I did for windows ? (As Im newbie in Linux C will kill me)
Anybody can help me ?
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
How to translate a date
if you run the command uptime, i think it extrapolates it from the output of /proc/uptime (cat /proc/uptime), you could download the source for the procps package and go thru the source of the uptime command for inspiration if you want to make your own (:
Eagles may soar, but weasels don't get sucked into jet engines...
Of course everyone loves perl... :-D
You can do it like this:
This code will print the given time in the given format. If you save it as a script, the first argument of it is the time in seconds, and the second is the format.
You can do it like this:
Code: Select all
#!/usr/bin/perl
use POSIX qw(strftime);
$time="";
$format="%Y.%m.%d %H:%M:%S";
if ($ARGV[1]) {
$format="$ARGV[1]";
}
if ($ARGV[0]) {
$time=$ARGV[0];
}
print strftime "$format\n", localtime $time;