'date' command oddities

I have QNX running on a client site and I have seen a couple instances
of odd behaviour. I am running ver. 4.22, doing a uname -a I get:
QNX 69 B 422 PCI 32 First, this is an excerpt from a telnet session:

pcm45:/pcm/data# ls -l
total 427
drwxrwxrwx 2 Procsol pcm_dev 2048 Dec 20 12:40 .
drwxrwxrwx 15 Procsol pcm_dev 2048 Dec 21 1999 …
-rw-rw-r-- 1 root root 196167 Dec 20 12:40 dbase.P2_dat
-r–r–r-- 1 Procsol pcm_dev 17709 May 23 1997 ioscan_conv.dat
pcm45:/pcm/data# ls -l
total 864
drwxrwxrwx 2 Procsol pcm_dev 2048 Dec 20 11:05 .
drwxrwxrwx 15 Procsol pcm_dev 2048 Dec 21 1999 …
-rw-rw-r-- 1 root root 196167 Dec 20 11:05 dbase.P2_dat
-rw-rw-r-- 1 root root 196167 Dec 20 12:40 dbase.old
-rw-rw-r-- 1 root root 26994 Dec 20 11:04 ilock.P2_dat
-r–r–r-- 1 Procsol pcm_dev 17709 May 23 1997 i

These two ls -l commands were issued within 15 seconds. There was no
ftp or nfs or any other user logged on at the time. Just strange that
the directory contents change for no apparent reason. At this point I
am logged in as root and the time is 09:03:22 MST (mountain time).
Notice the discrepency in times as well. This is the second oddity.
Other odd behavior. I did this earlier today. Running a ‘date’
command from an user account:
Fri Dec 22 14:27:05 mst 2000
From root (su):
Fri Dec 22 16:27:29 EST 2000
Notice, correct time, wrong timezone. Why would I get different time
zones from different accounts? Newbie here, in case you couldn’t
tell. Is this a configuration thing? These computers are set up by
our clients so I have not had much experience setting up QNX. Any
insight would be apprciated.

Thanks!!

Trevor
Trevor Osatchuk

Previously, Trevor Osatchuk wrote in comp.os.qnx:

I have QNX running on a client site and I have seen a couple instances
of odd behaviour. I am running ver. 4.22, doing a uname -a I get:
QNX 69 B 422 PCI 32 First, this is an excerpt from a telnet session:

pcm45:/pcm/data# ls -l
total 427
drwxrwxrwx 2 Procsol pcm_dev 2048 Dec 20 12:40 .
drwxrwxrwx 15 Procsol pcm_dev 2048 Dec 21 1999 …
-rw-rw-r-- 1 root root 196167 Dec 20 12:40 dbase.P2_dat
-r–r–r-- 1 Procsol pcm_dev 17709 May 23 1997 ioscan_conv.dat
pcm45:/pcm/data# ls -l
total 864
drwxrwxrwx 2 Procsol pcm_dev 2048 Dec 20 11:05 .
drwxrwxrwx 15 Procsol pcm_dev 2048 Dec 21 1999 …
-rw-rw-r-- 1 root root 196167 Dec 20 11:05 dbase.P2_dat
-rw-rw-r-- 1 root root 196167 Dec 20 12:40 dbase.old
-rw-rw-r-- 1 root root 26994 Dec 20 11:04 ilock.P2_dat
-r–r–r-- 1 Procsol pcm_dev 17709 May 23 1997 i

These two ls -l commands were issued within 15 seconds. There was no
ftp or nfs or any other user logged on at the time. Just strange that
the directory contents change for no apparent reason.

Wild guess: your database program created a lock file (ilock.P2_dat) while it updated your database (dbase.P2_dat). That doesn’t explain why dbase.old is newer than dbase.P2_dat, though…


At this point I
am logged in as root and the time is 09:03:22 MST (mountain time).
Notice the discrepency in times as well. This is the second oddity.
Other odd behavior. I did this earlier today. Running a ‘date’
command from an user account:
Fri Dec 22 14:27:05 mst 2000
From root (su):
Fri Dec 22 16:27:29 EST 2000
Notice, correct time, wrong timezone. Why would I get different time
zones from different accounts? Newbie here, in case you couldn’t
tell. Is this a configuration thing? These computers are set up by
our clients so I have not had much experience setting up QNX. Any
insight would be apprciated.

The environment variable TZ controls the time zone for every login. Each user can set their time zone. If TZ isn’t set, the default is EST5EDT. The system uses UTC to record the actual time. (I’m pretty sure this is standard Unix behavior.)

  • Pete