Nicholas
10th January 2007, 18:14
I am using qptool6.2 to export data from the Job Data table (ttaad500)

qptool6.2 -c 910 -q "select ttaad500._compnr, jsta, user, cjob, ttaad500.desc, ldat from ttaad500"

For the last execution date, I am getting 1168387206, when I look in Baan it tells me Jan. 9th, 2007 at 17:00:06. Informix it tells me Jan 9th, at 00:00:06.

I am trying to figure out how to convert 1168387206 to a proper date format. I understand I need to convert from GMT to my local time zone.

I need to display the proper date in a UNIX script.

Any help would be great.

Thanks.

norwim
10th January 2007, 21:53
Hi Nicholas,

no unix box available for me atm - sorry.
From memory the 'date' command creates a time stamp which is a number of seconds since year 1.1.1970 00:00:00, if called like 'date "+%s".
Anyway, I think I remember having ben told that Baan does count seconds from year 0 00:00:00.
So you should be able to calculate the difference.
Here's something I found in google:

#date -d ‘1970-01-01 1000000000 sec GMT’
Sat Sep 8 20:46:40 CDT 2001

#date -d ‘1970-01-01 1000000000 sec’
Sun Sep 9 02:46:40 CDT 2001

hth

Norbert

P.S.: Anyway, have you ever considered to use bdbpre6.1 instead of qptool?
As the table in question is
a) so small that it will be dumped in milliseconds and
b) not likely to be changed while you read it
you may ommit the fact that a tables is locked while beeing dumped with bdbpre.
That would give you the date in MMDDYYYY and number of seconds from 0:00 IIRC.