Time Zone

We have a product that uses QNX 4.2.5 and could be used in many
different countries. We would like to be able to set and change the
date and time (including time zone) of the system by a remote PC with
custom software (using telnet for example) sometime after the original
install is done depending upon the countries date, time and timezone.
Does anyone have an idea as the best way to do this? I know that the TZ
environment variable exists in the sysinit.1 file. It does seem
possible to modify this TZ variable of this file remotely (by telnet)
and reboot the machine although it also seems dangerous (if sysinit.1 is
corrupted). Also, where can I find additional information on what the
abbreviations are for all of the different time zones world wide (for
example, EST, EDT). I appreciate anyone with a plausible solution.
Thank You.

Dan Szymanski

You could create a file that contains the value of the TZ variables and from
the sysinit
do: TZ=$(cat /etc/TIMEZONE) 2>/dev/null) , this is taken from QNX6 :wink:

As for the diffent value for TZ, check the online-doc. TZ complies with
UNIX TZ so it’s easy to find info on the web.

“Dan Szymanski” <szymanski@sanyo-machine.com> wrote in message
news:3B7AE188.A4EABA43@sanyo-machine.com

We have a product that uses QNX 4.2.5 and could be used in many
different countries. We would like to be able to set and change the
date and time (including time zone) of the system by a remote PC with
custom software (using telnet for example) sometime after the original
install is done depending upon the countries date, time and timezone.
Does anyone have an idea as the best way to do this? I know that the TZ
environment variable exists in the sysinit.1 file. It does seem
possible to modify this TZ variable of this file remotely (by telnet)
and reboot the machine although it also seems dangerous (if sysinit.1 is
corrupted). Also, where can I find additional information on what the
abbreviations are for all of the different time zones world wide (for
example, EST, EDT). I appreciate anyone with a plausible solution.
Thank You.

Dan Szymanski

Mario,

Thank you for the reply. I am slightly confused by the TZ= command you supplied
below:

TZ=$(cat /etc/TIMEZONE) 2>/dev/null)

It seems that he brackets do not show proper agreement [one left “(” and two
right “))”]

Also. is TIMEZONE the name of the file that stores the info and what is the
significance of “2>/dev/null”.

Thank you again.

Dan Szymanski



Mario Charest wrote:

You could create a file that contains the value of the TZ variables and from
the sysinit
do: TZ=$(cat /etc/TIMEZONE) 2>/dev/null) , this is taken from QNX6 > :wink:

As for the diffent value for TZ, check the online-doc. TZ complies with
UNIX TZ so it’s easy to find info on the web.

“Dan Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3B7AE188.A4EABA43@sanyo-machine.com> …
We have a product that uses QNX 4.2.5 and could be used in many
different countries. We would like to be able to set and change the
date and time (including time zone) of the system by a remote PC with
custom software (using telnet for example) sometime after the original
install is done depending upon the countries date, time and timezone.
Does anyone have an idea as the best way to do this? I know that the TZ
environment variable exists in the sysinit.1 file. It does seem
possible to modify this TZ variable of this file remotely (by telnet)
and reboot the machine although it also seems dangerous (if sysinit.1 is
corrupted). Also, where can I find additional information on what the
abbreviations are for all of the different time zones world wide (for
example, EST, EDT). I appreciate anyone with a plausible solution.
Thank You.

Dan Szymanski

“Dan Szymanski” <szymanski@sanyo-machine.com> wrote in message
news:3B7D8DAA.897D07D9@sanyo-machine.com

Mario,

Thank you for the reply. I am slightly confused by the TZ= command you
supplied
below:

TZ=$(cat /etc/TIMEZONE) 2>/dev/null)

It seems that he brackets do not show proper agreement [one left “(” and
two
right “))”]

Woops should be

TZ=$(cat /etc/TIMEZONE 2>/dev/null)

Also. is TIMEZONE the name of the file that stores the info

Yes, the file would contain for example est05edt04,M4.1.0/2,M10.5.0/2
(eastern time zone with daylight saving)

and what is the significance of “2>/dev/null”.

The 2> is the redirection for standard error. If an error occurs

TZ will not be set to the error string as it was send to /dev/null.
/dev/null is nothingness :wink:


Thank you again.

Dan Szymanski



Mario Charest wrote:

You could create a file that contains the value of the TZ variables and
from
the sysinit
do: TZ=$(cat /etc/TIMEZONE) 2>/dev/null) , this is taken from QNX6 > :wink:

As for the diffent value for TZ, check the online-doc. TZ complies with
UNIX TZ so it’s easy to find info on the web.

“Dan Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3B7AE188.A4EABA43@sanyo-machine.com> …
We have a product that uses QNX 4.2.5 and could be used in many
different countries. We would like to be able to set and change the
date and time (including time zone) of the system by a remote PC with
custom software (using telnet for example) sometime after the original
install is done depending upon the countries date, time and timezone.
Does anyone have an idea as the best way to do this? I know that the
TZ
environment variable exists in the sysinit.1 file. It does seem
possible to modify this TZ variable of this file remotely (by telnet)
and reboot the machine although it also seems dangerous (if sysinit.1
is
corrupted). Also, where can I find additional information on what the
abbreviations are for all of the different time zones world wide (for
example, EST, EDT). I appreciate anyone with a plausible solution.
Thank You.

Dan Szymanski

Thank you Mario,

I tested this and it works under QNX 4 also, however, the brackets () should be
braces {}.

Dan Szymanski


Mario Charest wrote:

“Dan Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3B7D8DAA.897D07D9@sanyo-machine.com> …
Mario,

Thank you for the reply. I am slightly confused by the TZ= command you
supplied
below:

TZ=$(cat /etc/TIMEZONE) 2>/dev/null)

It seems that he brackets do not show proper agreement [one left “(” and
two
right “))”]

Woops should be
TZ=$(cat /etc/TIMEZONE 2>/dev/null)

Also. is TIMEZONE the name of the file that stores the info

Yes, the file would contain for example est05edt04,M4.1.0/2,M10.5.0/2
(eastern time zone with daylight saving)

and what is the significance of “2>/dev/null”.

The 2> is the redirection for standard error. If an error occurs
TZ will not be set to the error string as it was send to /dev/null.
/dev/null is nothingness > :wink:

Thank you again.

Dan Szymanski



Mario Charest wrote:

You could create a file that contains the value of the TZ variables and
from
the sysinit
do: TZ=$(cat /etc/TIMEZONE) 2>/dev/null) , this is taken from QNX6 > :wink:

As for the diffent value for TZ, check the online-doc. TZ complies with
UNIX TZ so it’s easy to find info on the web.

“Dan Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3B7AE188.A4EABA43@sanyo-machine.com> …
We have a product that uses QNX 4.2.5 and could be used in many
different countries. We would like to be able to set and change the
date and time (including time zone) of the system by a remote PC with
custom software (using telnet for example) sometime after the original
install is done depending upon the countries date, time and timezone.
Does anyone have an idea as the best way to do this? I know that the
TZ
environment variable exists in the sysinit.1 file. It does seem
possible to modify this TZ variable of this file remotely (by telnet)
and reboot the machine although it also seems dangerous (if sysinit.1
is
corrupted). Also, where can I find additional information on what the
abbreviations are for all of the different time zones world wide (for
example, EST, EDT). I appreciate anyone with a plausible solution.
Thank You.

Dan Szymanski