stephnane,
Two solutions. Check out the
site for date routines, a single line PERL solution.
use Date::Calc qw(Add_Delta_DHMS);
($year2, $month2, $day2, $h2, $m2, $s2) =
Add_Delta_DHMS( $year, $month, $day, $hour, $minute, $second,
$days_offset, $hour_offset, $minute_offset, $second_offset );
or use epoch seconds, again thru perl or a simple C program.
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
/* converting epoch seconds to a date */
main (int argc, char *argv[])
{
int epoch;
epoch = atoi(argv[1]);
printf("%d %s",epoch,ctime(&epoch));
}
gvasrcsm01(lucm02a):/home/lucm02a/C $ cat epochtimenow.c
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
/* giving you todays date in epoch seconds */
main (int argc, char *argv[])
{
int epoch;
time((int *)&epoch);
printf("%d\n",epoch);
}