1849264 Members
5303 Online
104042 Solutions
New Discussion

Re: Date and Time

 
JFS_1
Advisor

Date and Time

Hi All,

i have questions about the date and time and HP-UX...

How can i check and change the real system date and time ?
CATIA does not use the time given by "date"...

Which is the function of the "date"-time ?

Thx
9 REPLIES 9
Olav Baadsvik
Esteemed Contributor

Re: Date and Time


Hello,

Without really knowing what your problem is
I have these comments/questions.

. Using the command date in a shell does
it return correct data. If not check
the value of the environment-variable TZ

. I would guess CATIA uses some c-function
to get info about date/time. All of these
functions depend on what TZ is set to. So
check if TZ is set correctly (and exported)
when you start CATIA

Olav
JFS_1
Advisor

Re: Date and Time

Hi Olav,

my problem is :

- the command date gives : 9.25 am
- when i write a CATIA-model, the time of the file is 8.25 am

Why this difference ??

I have set MET-1METDST.

thx
Michael Tully
Honored Contributor

Re: Date and Time

You can view that date/time with the 'date' command. The man page gives some good examples.
If you intend changing the time backwards, beware that databases do not like it all, and you could crsah these. To change the timezone, use the 'set_parms' command.

# set_parms -timezone

Have a look at the man page for this also, it does mention that you need to reboot your system.
Anyone for a Mutiny ?
Ramkumar Devanathan
Honored Contributor

Re: Date and Time

See manpage for your date command.

If your particular application does not use the time given by the date command, what else could it be using?

Can you point out the places where it differs - some log entry is dated different from the actual system time?

Maybe if you see the manuals for your application, there is some mention of this - maybe that the date is written following GMT, etc rather than the actual TZ.

system date is obtained as a long in C language, using the ftime command.

to set a new time on your system, as root run date -u [+format].

of course, if ntp is running on your system and there's a time server available on your network, the time would typically get adjusted to synch with the time server.

HTH.

- ramd.
HPE Software Rocks!
T G Manikandan
Honored Contributor

Re: Date and Time

When the

#set_parms timezone should synchronize all times

You have the RTC,file system time and system time.

This document should help you

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000063203197

Thanks
Leif Halvarsson_2
Honored Contributor

Re: Date and Time

Hi,
I think CATIA uses some C time subroutine, It depends on which subroutine used if adjusted for daylight saving time or not (check the man 3 page for ctime). Which subroutine CATIA uses can perhaps only someone from CATIA give an answere to.
Michael Tully
Honored Contributor

Re: Date and Time

Another quick method is to make sure that your application is actually seeing the correct timezone. Make sure that your application reads in the /etc/TIMEZONE file.
Anyone for a Mutiny ?
Olav Baadsvik
Esteemed Contributor

Re: Date and Time


Hello,

A very usual way for a c-program to obtain
date/time info is to do the following:

time_t secs;
struct tm *tid;

secs = time(0);
tid = localtime(&secs);

The call to time returns the number of seconds
passed since the Epoch.
The call to localtime converts this info to
a more usable format, using information
from /usr/lib/tztab about your timezone, daylight-saving time.
What entry in tztab that is used depends on
the value of the environment-variable TZ.

It may be that CATIA only uses a call to time() and has some other method of converting this info to your local-time, but I doubt it.
If you still get the time wrong after beeing
100% sure that CATIA is started in such a way
that it picks up the correct TZ, it is time
to contact the vendor of CATIA to see if some
other config-value is missing.

Olav
Donny Jekels
Respected Contributor

Re: Date and Time

you should think about turning NTP on.

edit the /etc/ntp.conf file with valid NTP server names.

you may add a drift file

/etc/ntp.drift

a good value = 3.849 0

then in /etc/rc.config.d/netdaemons file

there is 3 lines to edit

export NTPDATE_SERVER="sometimeserver.internet.com"
export XNTPD=1
export XNTPD_ARGS=" -c /etc/ntp.conf"

almost there.


then run /sbin/init.d/xntpd start

ntp should be running, then you never have to worry about your system clock again.

#ntpq -p

checks the network time.

peace
Donny




"Vision, is the art of seeing the invisible"