TIMEZONE string

I currently have a QNX 4.25 machine running with

TZ=est05edt04,M4.1.0/2,M10.5.0/2

I changed the date on the system to check the changes from est to edt
and vice versa. I found that the spring forward change for the first
sunday in april worked OK, but the change for the last sunday in october
did not (the time remained the same). Any suggestions?

Thank you.

Dan Szymanski

The end of October is a good time of year to buy a new computer each year
;~}

Actually, I have not had this problem. Can you give more details, time
before the change, time after the changem indicated time after the change,
OS version, version of ‘date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


“Daniel A. Szymanski” <szymanski@sanyo-machine.com> wrote in message
news:3C22603F.F0EE18E3@sanyo-machine.com

I currently have a QNX 4.25 machine running with

TZ=est05edt04,M4.1.0/2,M10.5.0/2

I changed the date on the system to check the changes from est to edt
and vice versa. I found that the spring forward change for the first
sunday in april worked OK, but the change for the last sunday in october
did not (the time remained the same). Any suggestions?

Thank you.

Dan Szymanski

Just my $0.02 US…

You really need to be looking at the UTC date stamp too. When you set your
computer to 10/28/2001 1:59:00 you probably have all ready gone past the
actual “fall back” time… The hour from 1:00-1:59 am actually occurs twice
that evening. Try setting it to 0:59:00 and wait 61 minutes :wink: Also, when
you execute ‘date’ does it report est or edt?

Rob

“Daniel A. Szymanski” <szymanski@sanyo-machine.com> wrote in message
news:3C227D7A.8D2D8B2@sanyo-machine.com

Bill,

Basically, I did the following (TZ=est05edt04,M4.1.0/2,M10.5.0/2) which I
believe means that the time will move ahead one hour at 2:00 am on the
first
Sunday in April and will move back one hour at 2:00 a.m. on the last
Sunday of
October.

QNX 4.25 is the OS
How would I go about getting the version of ‘date’?

I set the date to 4/1/2001 and the time to 1:59:00 am with the date
command.
In one minute, the date shows 4/1/2001 3:00 am (which is correct)

I then set the date to 10/28/2001 and the time to 1:59:00 am with the date
command. In one minute, the date shows 10/28/2001 and the time 2:00:00 am
(which I believe is not correct).



Bill Caroselli wrote:

The end of October is a good time of year to buy a new computer each
year
;~}

Actually, I have not had this problem. Can you give more details, time
before the change, time after the changem indicated time after the
change,
OS version, version of ‘date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3C22603F.F0EE18E3@sanyo-machine.com> …
I currently have a QNX 4.25 machine running with

TZ=est05edt04,M4.1.0/2,M10.5.0/2

I changed the date on the system to check the changes from est to edt
and vice versa. I found that the spring forward change for the first
sunday in april worked OK, but the change for the last sunday in
october
did not (the time remained the same). Any suggestions?

Thank you.

Dan Szymanski

Bill,

Basically, I did the following (TZ=est05edt04,M4.1.0/2,M10.5.0/2) which I
believe means that the time will move ahead one hour at 2:00 am on the first
Sunday in April and will move back one hour at 2:00 a.m. on the last Sunday of
October.

QNX 4.25 is the OS
How would I go about getting the version of ‘date’?

I set the date to 4/1/2001 and the time to 1:59:00 am with the date command.
In one minute, the date shows 4/1/2001 3:00 am (which is correct)

I then set the date to 10/28/2001 and the time to 1:59:00 am with the date
command. In one minute, the date shows 10/28/2001 and the time 2:00:00 am
(which I believe is not correct).



Bill Caroselli wrote:

The end of October is a good time of year to buy a new computer each year
;~}

Actually, I have not had this problem. Can you give more details, time
before the change, time after the changem indicated time after the change,
OS version, version of ‘date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3C22603F.F0EE18E3@sanyo-machine.com> …
I currently have a QNX 4.25 machine running with

TZ=est05edt04,M4.1.0/2,M10.5.0/2

I changed the date on the system to check the changes from est to edt
and vice versa. I found that the spring forward change for the first
sunday in april worked OK, but the change for the last sunday in october
did not (the time remained the same). Any suggestions?

Thank you.

Dan Szymanski

Previously, Rob wrote in qdn.public.qnx4.devtools:
What we have found is that if you change the time back during the 1 hour interval between normal and daylight saving time that the resulting time is always messed up

Just my $0.02 US…

You really need to be looking at the UTC date stamp too. When you set your
computer to 10/28/2001 1:59:00 you probably have all ready gone past the
actual “fall back” time… The hour from 1:00-1:59 am actually occurs twice
that evening. Try setting it to 0:59:00 and wait 61 minutes > :wink: > Also, when
you execute ‘date’ does it report est or edt?

Rob

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3C227D7A.8D2D8B2@sanyo-machine.com> …
Bill,

Basically, I did the following (TZ=est05edt04,M4.1.0/2,M10.5.0/2) which I
believe means that the time will move ahead one hour at 2:00 am on the
first
Sunday in April and will move back one hour at 2:00 a.m. on the last
Sunday of
October.

QNX 4.25 is the OS
How would I go about getting the version of ‘date’?

I set the date to 4/1/2001 and the time to 1:59:00 am with the date
command.
In one minute, the date shows 4/1/2001 3:00 am (which is correct)

I then set the date to 10/28/2001 and the time to 1:59:00 am with the date
command. In one minute, the date shows 10/28/2001 and the time 2:00:00 am
(which I believe is not correct).



Bill Caroselli wrote:

The end of October is a good time of year to buy a new computer each
year
;~}

Actually, I have not had this problem. Can you give more details, time
before the change, time after the changem indicated time after the
change,
OS version, version of ‘date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3C22603F.F0EE18E3@sanyo-machine.com> …
I currently have a QNX 4.25 machine running with

TZ=est05edt04,M4.1.0/2,M10.5.0/2

I changed the date on the system to check the changes from est to edt
and vice versa. I found that the spring forward change for the first
sunday in april worked OK, but the change for the last sunday in
october
did not (the time remained the same). Any suggestions?

Thank you.

Dan Szymanski


\

OK. I’ve read the other two comments. But I alwys thought that at 3:00 AM
the clock went back to 2 AM. So I think you didn’t set it ahead enough.
Just show that none of us really know what we’re talking about.

RE: version of date, just do ‘which -l date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


“Ian Cannon” <ianc@tecom.com.au> wrote in message
news:Voyager.011221114303.22734A@aresnode2.tecom.com.au

Previously, Rob wrote in qdn.public.qnx4.devtools:
What we have found is that if you change the time back during the 1 hour
interval between normal and daylight saving time that the resulting time is

always messed up

Just my $0.02 US…

You really need to be looking at the UTC date stamp too. When you set
your
computer to 10/28/2001 1:59:00 you probably have all ready gone past the
actual “fall back” time… The hour from 1:00-1:59 am actually occurs
twice
that evening. Try setting it to 0:59:00 and wait 61 minutes > :wink: > Also,
when
you execute ‘date’ does it report est or edt?

Rob

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3C227D7A.8D2D8B2@sanyo-machine.com> …
Bill,

Basically, I did the following (TZ=est05edt04,M4.1.0/2,M10.5.0/2)
which I
believe means that the time will move ahead one hour at 2:00 am on the
first
Sunday in April and will move back one hour at 2:00 a.m. on the last
Sunday of
October.

QNX 4.25 is the OS
How would I go about getting the version of ‘date’?

I set the date to 4/1/2001 and the time to 1:59:00 am with the date
command.
In one minute, the date shows 4/1/2001 3:00 am (which is correct)

I then set the date to 10/28/2001 and the time to 1:59:00 am with the
date
command. In one minute, the date shows 10/28/2001 and the time
2:00:00 am
(which I believe is not correct).



Bill Caroselli wrote:

The end of October is a good time of year to buy a new computer each
year
;~}

Actually, I have not had this problem. Can you give more details,
time
before the change, time after the changem indicated time after the
change,
OS version, version of ‘date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3C22603F.F0EE18E3@sanyo-machine.com> …
I currently have a QNX 4.25 machine running with

TZ=est05edt04,M4.1.0/2,M10.5.0/2

I changed the date on the system to check the changes from est to
edt
and vice versa. I found that the spring forward change for the
first
sunday in april worked OK, but the change for the last sunday in
october
did not (the time remained the same). Any suggestions?

Thank you.

Dan Szymanski



\

Speak for yourself, Bill :wink:

Here’s a little test program that demonstrates I do know what I’m talking
about…

Output for central time should be:

Spring Equinox = Sun Apr 01 00:00:00 2001 cst
Tick… = Sun Apr 01 01:59:59 2001 cst
Tick… = Sun Apr 01 03:00:00 2001 cdt
Tick… = Sun Apr 01 03:00:01 2001 cdt
Fall Equinox = Sun Oct 28 00:00:00 2001 cdt
Tick… = Sun Oct 28 01:59:59 2001 cdt
Tick… = Sun Oct 28 01:00:00 2001 cst
Tick… = Sun Oct 28 01:00:01 2001 cst

Rob

P.S.
Everyone does understand (now) that 10/28/2001 1:59:00 is ambiguous… with
out a DST indicator… right??

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>

void main( void )
{
int i;
char tbuf[80];
time_t t;
struct tm tm, *ptm;

//
// Get the struct tm for today… we’ll need it.
//
time( &t );
ptm = localtime( &t );

//
// Find the Spring Equinox for this year.
// First Sunday in April
//

memset( &tm, 0, sizeof( tm ) );

tm.tm_mon = 3;
tm.tm_year = ptm->tm_year;

do {
tm.tm_mday += 1;
tm.tm_isdst = -1; // Let mktime() figure out tm_isdst
t = mktime( &tm );
ptm = localtime( &t );
} while( ptm->tm_wday != 0 );

strftime( tbuf, 80, “%c %Z”, &tm );

printf( “Spring Equinox = %s\n”, tbuf );

//
// OK… we’re at midnight.
// Add 1 hour + 59 minutes + 59 seconds (= 7199 seconds)
// So we’re 1 second before time change
// And then do 3 ticks through time change
//

for( t += 7199, i = 0; i < 3; t++, i++ ) {
ptm = localtime( &t );

strftime( tbuf, 80, “%c %Z”, ptm );

printf( “Tick… = %s\n”, tbuf );
}

//
// Another verse, same as the first… except for the Fall Equinox
//

//
// Find the Fall Equinox for this year.
// Last Sunday in October
//

memset( &tm, 0, sizeof( tm ) );

tm.tm_mon = 9;
tm.tm_mday = 32; // 1 day past end-of-month, so do/while()
works right
tm.tm_year = ptm->tm_year;

do {
tm.tm_mday -= 1;
tm.tm_isdst = -1; // Let mktime() figure out tm_isdst
t = mktime( &tm );
ptm = localtime( &t );
} while( ptm->tm_wday != 0 );

strftime( tbuf, 80, “%c %Z”, &tm );

printf( “Fall Equinox = %s\n”, tbuf );

//
// OK… we’re at midnight.
// Add 1 hour + 59 minutes + 59 seconds (= 7199 seconds)
// So we’re 1 second before time change
// And then do 3 ticks through time change
//

for( t += 7199, i = 0; i < 3; t++, i++ ) {
ptm = localtime( &t );

strftime( tbuf, 80, “%c %Z”, ptm );

printf( “Tick… = %s\n”, tbuf );
}
}



“Bill Caroselli” <qtps@earthlink.net> wrote in message
news:9vvpna$nff$1@inn.qnx.com

OK. I’ve read the other two comments. But I alwys thought that at 3:00
AM
the clock went back to 2 AM. So I think you didn’t set it ahead enough.
Just show that none of us really know what we’re talking about.

RE: version of date, just do ‘which -l date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


“Ian Cannon” <> ianc@tecom.com.au> > wrote in message
news:> Voyager.011221114303.22734A@aresnode2.tecom.com.au> …
Previously, Rob wrote in qdn.public.qnx4.devtools:
What we have found is that if you change the time back during the 1 hour
interval between normal and daylight saving time that the resulting time
is
always messed up

Just my $0.02 US…

You really need to be looking at the UTC date stamp too. When you set
your
computer to 10/28/2001 1:59:00 you probably have all ready gone past
the
actual “fall back” time… The hour from 1:00-1:59 am actually occurs
twice
that evening. Try setting it to 0:59:00 and wait 61 minutes > :wink:
Also,
when
you execute ‘date’ does it report est or edt?

Rob

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3C227D7A.8D2D8B2@sanyo-machine.com> …
Bill,

Basically, I did the following (TZ=est05edt04,M4.1.0/2,M10.5.0/2)
which I
believe means that the time will move ahead one hour at 2:00 am on
the
first
Sunday in April and will move back one hour at 2:00 a.m. on the last
Sunday of
October.

QNX 4.25 is the OS
How would I go about getting the version of ‘date’?

I set the date to 4/1/2001 and the time to 1:59:00 am with the date
command.
In one minute, the date shows 4/1/2001 3:00 am (which is correct)

I then set the date to 10/28/2001 and the time to 1:59:00 am with
the
date
command. In one minute, the date shows 10/28/2001 and the time
2:00:00 am
(which I believe is not correct).



Bill Caroselli wrote:

The end of October is a good time of year to buy a new computer
each
year
;~}

Actually, I have not had this problem. Can you give more details,
time
before the change, time after the changem indicated time after the
change,
OS version, version of ‘date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in
message
news:> 3C22603F.F0EE18E3@sanyo-machine.com> …
I currently have a QNX 4.25 machine running with

TZ=est05edt04,M4.1.0/2,M10.5.0/2

I changed the date on the system to check the changes from est
to
edt
and vice versa. I found that the spring forward change for the
first
sunday in april worked OK, but the change for the last sunday in
october
did not (the time remained the same). Any suggestions?

Thank you.

Dan Szymanski





\

Rob,

It reported est when I thought that it should have reported edt. I believe that
you might be on to something here. What exactly do you mean when you say I need
to be looking at the UTC date stamp also. Also, is it true that for UTC to
work correctly, that rtc -l hw cannot be used when setting dates and times as
this will mess everything up (rtc -s hw should be used).

Thank you.

Dan Szymanski


Rob wrote:

Just my $0.02 US…

You really need to be looking at the UTC date stamp too. When you set your
computer to 10/28/2001 1:59:00 you probably have all ready gone past the
actual “fall back” time… The hour from 1:00-1:59 am actually occurs twice
that evening. Try setting it to 0:59:00 and wait 61 minutes > :wink: > Also, when
you execute ‘date’ does it report est or edt?

Rob

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3C227D7A.8D2D8B2@sanyo-machine.com> …
Bill,

Basically, I did the following (TZ=est05edt04,M4.1.0/2,M10.5.0/2) which I
believe means that the time will move ahead one hour at 2:00 am on the
first
Sunday in April and will move back one hour at 2:00 a.m. on the last
Sunday of
October.

QNX 4.25 is the OS
How would I go about getting the version of ‘date’?

I set the date to 4/1/2001 and the time to 1:59:00 am with the date
command.
In one minute, the date shows 4/1/2001 3:00 am (which is correct)

I then set the date to 10/28/2001 and the time to 1:59:00 am with the date
command. In one minute, the date shows 10/28/2001 and the time 2:00:00 am
(which I believe is not correct).



Bill Caroselli wrote:

The end of October is a good time of year to buy a new computer each
year
;~}

Actually, I have not had this problem. Can you give more details, time
before the change, time after the changem indicated time after the
change,
OS version, version of ‘date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3C22603F.F0EE18E3@sanyo-machine.com> …
I currently have a QNX 4.25 machine running with

TZ=est05edt04,M4.1.0/2,M10.5.0/2

I changed the date on the system to check the changes from est to edt
and vice versa. I found that the spring forward change for the first
sunday in april worked OK, but the change for the last sunday in
october
did not (the time remained the same). Any suggestions?

Thank you.

Dan Szymanski

Bill,

I think you are correct. Otherwise the bars would be open an extra hour. I got
the string (the changeback at 2:00 a.m.) from the QNX manual. I will try it at
three, but I bet it will behave the same. I think this problem will occure for
whichever hour is used in the string.

Thank you.

Dan Szymanski


Bill Caroselli wrote:

OK. I’ve read the other two comments. But I alwys thought that at 3:00 AM
the clock went back to 2 AM. So I think you didn’t set it ahead enough.
Just show that none of us really know what we’re talking about.

RE: version of date, just do ‘which -l date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net

“Ian Cannon” <> ianc@tecom.com.au> > wrote in message
news:> Voyager.011221114303.22734A@aresnode2.tecom.com.au> …
Previously, Rob wrote in qdn.public.qnx4.devtools:
What we have found is that if you change the time back during the 1 hour
interval between normal and daylight saving time that the resulting time is
always messed up

Just my $0.02 US…

You really need to be looking at the UTC date stamp too. When you set
your
computer to 10/28/2001 1:59:00 you probably have all ready gone past the
actual “fall back” time… The hour from 1:00-1:59 am actually occurs
twice
that evening. Try setting it to 0:59:00 and wait 61 minutes > :wink: > Also,
when
you execute ‘date’ does it report est or edt?

Rob

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3C227D7A.8D2D8B2@sanyo-machine.com> …
Bill,

Basically, I did the following (TZ=est05edt04,M4.1.0/2,M10.5.0/2)
which I
believe means that the time will move ahead one hour at 2:00 am on the
first
Sunday in April and will move back one hour at 2:00 a.m. on the last
Sunday of
October.

QNX 4.25 is the OS
How would I go about getting the version of ‘date’?

I set the date to 4/1/2001 and the time to 1:59:00 am with the date
command.
In one minute, the date shows 4/1/2001 3:00 am (which is correct)

I then set the date to 10/28/2001 and the time to 1:59:00 am with the
date
command. In one minute, the date shows 10/28/2001 and the time
2:00:00 am
(which I believe is not correct).



Bill Caroselli wrote:

The end of October is a good time of year to buy a new computer each
year
;~}

Actually, I have not had this problem. Can you give more details,
time
before the change, time after the changem indicated time after the
change,
OS version, version of ‘date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3C22603F.F0EE18E3@sanyo-machine.com> …
I currently have a QNX 4.25 machine running with

TZ=est05edt04,M4.1.0/2,M10.5.0/2

I changed the date on the system to check the changes from est to
edt
and vice versa. I found that the spring forward change for the
first
sunday in april worked OK, but the change for the last sunday in
october
did not (the time remained the same). Any suggestions?

Thank you.

Dan Szymanski



\

The ‘rtc -l hw’ thing is a separate issue. If you do use it, then after any
DST change (in the spring or fall), yes, you will need to do an ‘rtc -l -s
hw’ before you reboot the machine or it will be off by an hour. That is, of
course, if your local time zone is one that observes daylight savings time.

As for the original issue…
UTC doesn’t observe daylight savings time (for one thing) and it is how
system time is stored internally. Dealing with date-time in UTC will allow
you see what the time is really set at, not what you think is suppose to be.
You mentioned that the date-time was reported as ‘est’. That confirms what
I suspected… If you would have done a ‘date -u’, the output would be “Sun
Oct 28 06:59:00 UTC 2001” (= “Sun Oct 28 01:59:00 est 2001”), when what you
were looking for was “Sun Oct 28 05:59:00 UTC 2001” (= “Sun Oct 28 01:59:00
edt 2001”). Which is synonymous with the point I was trying to make in my
previous post… In a time zone that observes daylight savings time,
10/28/2001 01:59:00 is ambiguous. It could be daylight savings time or
standard time (since it happens twice that morning). It’s a flip of the
coin how any utility or internal function (e.g. date or mktime()) then
chooses to interpret it. Therefore, use UTC to eliminate the ambiguity.

Try setting your system time using UTC i.e. ‘date -u 200110280559.00’ and
everything should work fine.

Rob

“Daniel Szymanski” <szymanski@sanyo-machine.com> wrote in message
news:3C249080.F0F88BAE@sanyo-machine.com

Rob,

It reported est when I thought that it should have reported edt. I
believe that
you might be on to something here. What exactly do you mean when you say
I need
to be looking at the UTC date stamp also. Also, is it true that for UTC
to
work correctly, that rtc -l hw cannot be used when setting dates and times
as
this will mess everything up (rtc -s hw should be used).

Thank you.

Dan Szymanski


Rob wrote:

Just my $0.02 US…

You really need to be looking at the UTC date stamp too. When you set
your
computer to 10/28/2001 1:59:00 you probably have all ready gone past the
actual “fall back” time… The hour from 1:00-1:59 am actually occurs
twice
that evening. Try setting it to 0:59:00 and wait 61 minutes > :wink: > Also,
when
you execute ‘date’ does it report est or edt?

Rob

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3C227D7A.8D2D8B2@sanyo-machine.com> …
Bill,

Basically, I did the following (TZ=est05edt04,M4.1.0/2,M10.5.0/2)
which I
believe means that the time will move ahead one hour at 2:00 am on the
first
Sunday in April and will move back one hour at 2:00 a.m. on the last
Sunday of
October.

QNX 4.25 is the OS
How would I go about getting the version of ‘date’?

I set the date to 4/1/2001 and the time to 1:59:00 am with the date
command.
In one minute, the date shows 4/1/2001 3:00 am (which is correct)

I then set the date to 10/28/2001 and the time to 1:59:00 am with the
date
command. In one minute, the date shows 10/28/2001 and the time
2:00:00 am
(which I believe is not correct).



Bill Caroselli wrote:

The end of October is a good time of year to buy a new computer each
year
;~}

Actually, I have not had this problem. Can you give more details,
time
before the change, time after the changem indicated time after the
change,
OS version, version of ‘date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3C22603F.F0EE18E3@sanyo-machine.com> …
I currently have a QNX 4.25 machine running with

TZ=est05edt04,M4.1.0/2,M10.5.0/2

I changed the date on the system to check the changes from est to
edt
and vice versa. I found that the spring forward change for the
first
sunday in april worked OK, but the change for the last sunday in
october
did not (the time remained the same). Any suggestions?

Thank you.

Dan Szymanski
\

Ouch ! ! !

OK. I may have been mistaken. DOn’t take it so personally.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


P.S. I’ve been away for 2 weeks which is why I’m commenting on this now.

Happy New Year

“Rob” <rob@spamyourself.com> wrote in message
news:a006i9$2e4$1@inn.qnx.com

Speak for yourself, Bill > :wink:

Here’s a little test program that demonstrates I do know what I’m talking
about…

Output for central time should be:

Spring Equinox = Sun Apr 01 00:00:00 2001 cst
Tick… = Sun Apr 01 01:59:59 2001 cst
Tick… = Sun Apr 01 03:00:00 2001 cdt
Tick… = Sun Apr 01 03:00:01 2001 cdt
Fall Equinox = Sun Oct 28 00:00:00 2001 cdt
Tick… = Sun Oct 28 01:59:59 2001 cdt
Tick… = Sun Oct 28 01:00:00 2001 cst
Tick… = Sun Oct 28 01:00:01 2001 cst

Rob

P.S.
Everyone does understand (now) that 10/28/2001 1:59:00 is ambiguous…
with
out a DST indicator… right??

#include <stdio.h
#include <stdlib.h
#include <string.h
#include <time.h
#include <sys/types.h

void main( void )
{
int i;
char tbuf[80];
time_t t;
struct tm tm, *ptm;

//
// Get the struct tm for today… we’ll need it.
//
time( &t );
ptm = localtime( &t );

//
// Find the Spring Equinox for this year.
// First Sunday in April
//

memset( &tm, 0, sizeof( tm ) );

tm.tm_mon = 3;
tm.tm_year = ptm->tm_year;

do {
tm.tm_mday += 1;
tm.tm_isdst = -1; // Let mktime() figure out tm_isdst
t = mktime( &tm );
ptm = localtime( &t );
} while( ptm->tm_wday != 0 );

strftime( tbuf, 80, “%c %Z”, &tm );

printf( “Spring Equinox = %s\n”, tbuf );

//
// OK… we’re at midnight.
// Add 1 hour + 59 minutes + 59 seconds (= 7199 seconds)
// So we’re 1 second before time change
// And then do 3 ticks through time change
//

for( t += 7199, i = 0; i < 3; t++, i++ ) {
ptm = localtime( &t );

strftime( tbuf, 80, “%c %Z”, ptm );

printf( “Tick… = %s\n”, tbuf );
}

//
// Another verse, same as the first… except for the Fall Equinox
//

//
// Find the Fall Equinox for this year.
// Last Sunday in October
//

memset( &tm, 0, sizeof( tm ) );

tm.tm_mon = 9;
tm.tm_mday = 32; // 1 day past end-of-month, so do/while()
works right
tm.tm_year = ptm->tm_year;

do {
tm.tm_mday -= 1;
tm.tm_isdst = -1; // Let mktime() figure out tm_isdst
t = mktime( &tm );
ptm = localtime( &t );
} while( ptm->tm_wday != 0 );

strftime( tbuf, 80, “%c %Z”, &tm );

printf( “Fall Equinox = %s\n”, tbuf );

//
// OK… we’re at midnight.
// Add 1 hour + 59 minutes + 59 seconds (= 7199 seconds)
// So we’re 1 second before time change
// And then do 3 ticks through time change
//

for( t += 7199, i = 0; i < 3; t++, i++ ) {
ptm = localtime( &t );

strftime( tbuf, 80, “%c %Z”, ptm );

printf( “Tick… = %s\n”, tbuf );
}
}



“Bill Caroselli” <> qtps@earthlink.net> > wrote in message
news:9vvpna$nff$> 1@inn.qnx.com> …
OK. I’ve read the other two comments. But I alwys thought that at 3:00
AM
the clock went back to 2 AM. So I think you didn’t set it ahead enough.
Just show that none of us really know what we’re talking about.

RE: version of date, just do ‘which -l date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


“Ian Cannon” <> ianc@tecom.com.au> > wrote in message
news:> Voyager.011221114303.22734A@aresnode2.tecom.com.au> …
Previously, Rob wrote in qdn.public.qnx4.devtools:
What we have found is that if you change the time back during the 1
hour
interval between normal and daylight saving time that the resulting time
is
always messed up

Just my $0.02 US…

You really need to be looking at the UTC date stamp too. When you
set
your
computer to 10/28/2001 1:59:00 you probably have all ready gone past
the
actual “fall back” time… The hour from 1:00-1:59 am actually
occurs
twice
that evening. Try setting it to 0:59:00 and wait 61 minutes > :wink:
Also,
when
you execute ‘date’ does it report est or edt?

Rob

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3C227D7A.8D2D8B2@sanyo-machine.com> …
Bill,

Basically, I did the following (TZ=est05edt04,M4.1.0/2,M10.5.0/2)
which I
believe means that the time will move ahead one hour at 2:00 am on
the
first
Sunday in April and will move back one hour at 2:00 a.m. on the
last
Sunday of
October.

QNX 4.25 is the OS
How would I go about getting the version of ‘date’?

I set the date to 4/1/2001 and the time to 1:59:00 am with the
date
command.
In one minute, the date shows 4/1/2001 3:00 am (which is correct)

I then set the date to 10/28/2001 and the time to 1:59:00 am with
the
date
command. In one minute, the date shows 10/28/2001 and the time
2:00:00 am
(which I believe is not correct).



Bill Caroselli wrote:

The end of October is a good time of year to buy a new computer
each
year
;~}

Actually, I have not had this problem. Can you give more
details,
time
before the change, time after the changem indicated time after
the
change,
OS version, version of ‘date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in
message
news:> 3C22603F.F0EE18E3@sanyo-machine.com> …
I currently have a QNX 4.25 machine running with

TZ=est05edt04,M4.1.0/2,M10.5.0/2

I changed the date on the system to check the changes from est
to
edt
and vice versa. I found that the spring forward change for
the
first
sunday in april worked OK, but the change for the last sunday
in
october
did not (the time remained the same). Any suggestions?

Thank you.

Dan Szymanski







\

Well, now I’m not so sure.

But I am fairly certain that the people that run the bars don’t have the
final say. ;~}


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


“Daniel Szymanski” <szymanski@sanyo-machine.com> wrote in message
news:3C24926B.96BB2B5C@sanyo-machine.com

Bill,

I think you are correct. Otherwise the bars would be open an extra hour.
I got
the string (the changeback at 2:00 a.m.) from the QNX manual. I will try
it at
three, but I bet it will behave the same. I think this problem will
occure for
whichever hour is used in the string.

Thank you.

Dan Szymanski


Bill Caroselli wrote:

OK. I’ve read the other two comments. But I alwys thought that at 3:00
AM
the clock went back to 2 AM. So I think you didn’t set it ahead enough.
Just show that none of us really know what we’re talking about.

RE: version of date, just do ‘which -l date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net

“Ian Cannon” <> ianc@tecom.com.au> > wrote in message
news:> Voyager.011221114303.22734A@aresnode2.tecom.com.au> …
Previously, Rob wrote in qdn.public.qnx4.devtools:
What we have found is that if you change the time back during the 1
hour
interval between normal and daylight saving time that the resulting time
is
always messed up

Just my $0.02 US…

You really need to be looking at the UTC date stamp too. When you
set
your
computer to 10/28/2001 1:59:00 you probably have all ready gone past
the
actual “fall back” time… The hour from 1:00-1:59 am actually
occurs
twice
that evening. Try setting it to 0:59:00 and wait 61 minutes > :wink:
Also,
when
you execute ‘date’ does it report est or edt?

Rob

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in message
news:> 3C227D7A.8D2D8B2@sanyo-machine.com> …
Bill,

Basically, I did the following (TZ=est05edt04,M4.1.0/2,M10.5.0/2)
which I
believe means that the time will move ahead one hour at 2:00 am on
the
first
Sunday in April and will move back one hour at 2:00 a.m. on the
last
Sunday of
October.

QNX 4.25 is the OS
How would I go about getting the version of ‘date’?

I set the date to 4/1/2001 and the time to 1:59:00 am with the
date
command.
In one minute, the date shows 4/1/2001 3:00 am (which is correct)

I then set the date to 10/28/2001 and the time to 1:59:00 am with
the
date
command. In one minute, the date shows 10/28/2001 and the time
2:00:00 am
(which I believe is not correct).



Bill Caroselli wrote:

The end of October is a good time of year to buy a new computer
each
year
;~}

Actually, I have not had this problem. Can you give more
details,
time
before the change, time after the changem indicated time after
the
change,
OS version, version of ‘date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in
message
news:> 3C22603F.F0EE18E3@sanyo-machine.com> …
I currently have a QNX 4.25 machine running with

TZ=est05edt04,M4.1.0/2,M10.5.0/2

I changed the date on the system to check the changes from est
to
edt
and vice versa. I found that the spring forward change for
the
first
sunday in april worked OK, but the change for the last sunday
in
october
did not (the time remained the same). Any suggestions?

Thank you.

Dan Szymanski




\

I didn’t take it personally, Bill… I’ve recently been explaining all this
TZ business to a client, so I’m kind of up on it :wink:

Dan,
I hope it’s all ok/clear now??

Rob

“Bill Caroselli” <qtps@earthlink.net> wrote in message
news:a0vom7$hlk$4@inn.qnx.com

Ouch ! ! !

OK. I may have been mistaken. DOn’t take it so personally.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


P.S. I’ve been away for 2 weeks which is why I’m commenting on this now.

Happy New Year

“Rob” <> rob@spamyourself.com> > wrote in message
news:a006i9$2e4$> 1@inn.qnx.com> …
Speak for yourself, Bill > :wink:

Here’s a little test program that demonstrates I do know what I’m
talking
about…

Output for central time should be:

Spring Equinox = Sun Apr 01 00:00:00 2001 cst
Tick… = Sun Apr 01 01:59:59 2001 cst
Tick… = Sun Apr 01 03:00:00 2001 cdt
Tick… = Sun Apr 01 03:00:01 2001 cdt
Fall Equinox = Sun Oct 28 00:00:00 2001 cdt
Tick… = Sun Oct 28 01:59:59 2001 cdt
Tick… = Sun Oct 28 01:00:00 2001 cst
Tick… = Sun Oct 28 01:00:01 2001 cst

Rob

P.S.
Everyone does understand (now) that 10/28/2001 1:59:00 is ambiguous…
with
out a DST indicator… right??

#include <stdio.h
#include <stdlib.h
#include <string.h
#include <time.h
#include <sys/types.h

void main( void )
{
int i;
char tbuf[80];
time_t t;
struct tm tm, *ptm;

//
// Get the struct tm for today… we’ll need it.
//
time( &t );
ptm = localtime( &t );

//
// Find the Spring Equinox for this year.
// First Sunday in April
//

memset( &tm, 0, sizeof( tm ) );

tm.tm_mon = 3;
tm.tm_year = ptm->tm_year;

do {
tm.tm_mday += 1;
tm.tm_isdst = -1; // Let mktime() figure out tm_isdst
t = mktime( &tm );
ptm = localtime( &t );
} while( ptm->tm_wday != 0 );

strftime( tbuf, 80, “%c %Z”, &tm );

printf( “Spring Equinox = %s\n”, tbuf );

//
// OK… we’re at midnight.
// Add 1 hour + 59 minutes + 59 seconds (= 7199 seconds)
// So we’re 1 second before time change
// And then do 3 ticks through time change
//

for( t += 7199, i = 0; i < 3; t++, i++ ) {
ptm = localtime( &t );

strftime( tbuf, 80, “%c %Z”, ptm );

printf( “Tick… = %s\n”, tbuf );
}

//
// Another verse, same as the first… except for the Fall Equinox
//

//
// Find the Fall Equinox for this year.
// Last Sunday in October
//

memset( &tm, 0, sizeof( tm ) );

tm.tm_mon = 9;
tm.tm_mday = 32; // 1 day past end-of-month, so
do/while()
works right
tm.tm_year = ptm->tm_year;

do {
tm.tm_mday -= 1;
tm.tm_isdst = -1; // Let mktime() figure out tm_isdst
t = mktime( &tm );
ptm = localtime( &t );
} while( ptm->tm_wday != 0 );

strftime( tbuf, 80, “%c %Z”, &tm );

printf( “Fall Equinox = %s\n”, tbuf );

//
// OK… we’re at midnight.
// Add 1 hour + 59 minutes + 59 seconds (= 7199 seconds)
// So we’re 1 second before time change
// And then do 3 ticks through time change
//

for( t += 7199, i = 0; i < 3; t++, i++ ) {
ptm = localtime( &t );

strftime( tbuf, 80, “%c %Z”, ptm );

printf( “Tick… = %s\n”, tbuf );
}
}



“Bill Caroselli” <> qtps@earthlink.net> > wrote in message
news:9vvpna$nff$> 1@inn.qnx.com> …
OK. I’ve read the other two comments. But I alwys thought that at
3:00
AM
the clock went back to 2 AM. So I think you didn’t set it ahead
enough.
Just show that none of us really know what we’re talking about.

RE: version of date, just do ‘which -l date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


“Ian Cannon” <> ianc@tecom.com.au> > wrote in message
news:> Voyager.011221114303.22734A@aresnode2.tecom.com.au> …
Previously, Rob wrote in qdn.public.qnx4.devtools:
What we have found is that if you change the time back during the 1
hour
interval between normal and daylight saving time that the resulting
time
is
always messed up

Just my $0.02 US…

You really need to be looking at the UTC date stamp too. When you
set
your
computer to 10/28/2001 1:59:00 you probably have all ready gone
past
the
actual “fall back” time… The hour from 1:00-1:59 am actually
occurs
twice
that evening. Try setting it to 0:59:00 and wait 61 minutes > :wink:
Also,
when
you execute ‘date’ does it report est or edt?

Rob

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in
message
news:> 3C227D7A.8D2D8B2@sanyo-machine.com> …
Bill,

Basically, I did the following
(TZ=est05edt04,M4.1.0/2,M10.5.0/2)
which I
believe means that the time will move ahead one hour at 2:00 am
on
the
first
Sunday in April and will move back one hour at 2:00 a.m. on the
last
Sunday of
October.

QNX 4.25 is the OS
How would I go about getting the version of ‘date’?

I set the date to 4/1/2001 and the time to 1:59:00 am with the
date
command.
In one minute, the date shows 4/1/2001 3:00 am (which is
correct)

I then set the date to 10/28/2001 and the time to 1:59:00 am
with
the
date
command. In one minute, the date shows 10/28/2001 and the time
2:00:00 am
(which I believe is not correct).



Bill Caroselli wrote:

The end of October is a good time of year to buy a new
computer
each
year
;~}

Actually, I have not had this problem. Can you give more
details,
time
before the change, time after the changem indicated time after
the
change,
OS version, version of ‘date’.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net

“Daniel A. Szymanski” <> szymanski@sanyo-machine.com> > wrote in
message
news:> 3C22603F.F0EE18E3@sanyo-machine.com> …
I currently have a QNX 4.25 machine running with

TZ=est05edt04,M4.1.0/2,M10.5.0/2

I changed the date on the system to check the changes from
est
to
edt
and vice versa. I found that the spring forward change for
the
first
sunday in april worked OK, but the change for the last
sunday
in
october
did not (the time remained the same). Any suggestions?

Thank you.

Dan Szymanski









\