Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > Gentoo Linux Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-21-2008, 09:37 AM
Rene
 
Posts: n/a
Default Strange date thing

I was checking a date library and tested it against date.
There is one thing I found
date --date "19370701"
returns
Wed Jun 30 23:59:32 NST 1937

I have been checking 37331 dates
from date --date="19011216"
......
to date --date="20040229"
and only
date --date "19370701"
goes wrong.

I have checked with the coreutils maintainer of which date is part and
he couldn't reproduce it on his Debian machine

I have been pooking around and see that after a call to mktime (in
lib/getdate.c line 1302 coreutils 3.0.0 alpha) the tm structure is
filled in with data that I wouldn't expect.

I wonder is this specific for my machine. Not that it is a hugh problem
and I can live with it (How many times are you interested in 1937-07-01)
could someone see if it reproduce on his gentoo machine?

Thanks Rene

-----------------------software versions ----------------------------
I'm using
date --version
date (coreutils) 5.2.1

cat /proc/version
Linux version 2.4.28 (root@win2k) (gcc version 3.3.5 (Gentoo Linux
3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)) #17 Sun Mar 27 18:57:40 CEST 2005

/lib/libc.so.6
GNU C Library 20041102 release version 2.3.4, by Roland McGrath et al.
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3,
pie-8.7.7.1).
Compiled on a Linux 2.4.22 system on 2005-03-16.
Available extensions:
GNU libio by Per Bothner
crypt add-on version 2.1 by Michael Glad and others
linuxthreads-0.10 by Xavier Leroy
The C stubs add-on version 2.1.2.
GNU Libidn by Simon Josefsson
BIND-8.2.3-T5B
libthread_db work sponsored by Alpha Processor Inc
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Thread-local storage support included.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-21-2008, 09:37 AM
Jacob Tranholm
 
Posts: n/a
Default Re: Strange date thing

Rene wrote:

> I was checking a date library and tested it against date.
> There is one thing I found
> date --date "19370701"
> returns
> Wed Jun 30 23:59:32 NST 1937
>
> I have been checking 37331 dates
> from date --date="19011216"
> .....
> to date --date="20040229"
> and only
> date --date "19370701"
> goes wrong.
>
> I have checked with the coreutils maintainer of which date is part and
> he couldn't reproduce it on his Debian machine
>
> I have been pooking around and see that after a call to mktime (in
> lib/getdate.c line 1302 coreutils 3.0.0 alpha) the tm structure is
> filled in with data that I wouldn't expect.
>
> I wonder is this specific for my machine. Not that it is a hugh problem
> and I can live with it (How many times are you interested in 1937-07-01)
> could someone see if it reproduce on his gentoo machine?
>
> Thanks Rene
>
> -----------------------software versions ----------------------------
> I'm using
> date --version
> date (coreutils) 5.2.1
>
> cat /proc/version
> Linux version 2.4.28 (root@win2k) (gcc version 3.3.5 (Gentoo Linux
> 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)) #17 Sun Mar 27 18:57:40 CEST 2005
>
> /lib/libc.so.6
> GNU C Library 20041102 release version 2.3.4, by Roland McGrath et al.
> Copyright (C) 2004 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.
> There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
> PARTICULAR PURPOSE.
> Compiled by GNU CC version 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3,
> pie-8.7.7.1).
> Compiled on a Linux 2.4.22 system on 2005-03-16.
> Available extensions:
> GNU libio by Per Bothner
> crypt add-on version 2.1 by Michael Glad and others
> linuxthreads-0.10 by Xavier Leroy
> The C stubs add-on version 2.1.2.
> GNU Libidn by Simon Josefsson
> BIND-8.2.3-T5B
> libthread_db work sponsored by Alpha Processor Inc
> NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
> Thread-local storage support included.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/libc/bugs.html>


It is not reproducible at my computer:
-----
jt@tranholm jt $ date --date "19370701"
tor jul 1 00:00:00 CET 1937
jt@tranholm jt $ date --version
date (coreutils) 5.2.1
Written by David MacKenzie.

Copyright (C) 2004 Free Software Foundation, Inc.
Dette er frit programmel; se kildeteksten for betingelser for kopiering. Der
erINGEN
garanti; ikke engang for SALGBARHED eller EGNETHED FOR ET SPECIELT FORMÅL.
jt@tranholm jt $ cat /proc/version
Linux version 2.6.11-gentoo-r4 (root@tranholm) (GCC version 3.3.5 (Gentoo
Linux3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)) #1 Sat Mar 26 03:01:17 CET 2005
-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-21-2008, 09:37 AM
Michael Mauch
 
Posts: n/a
Default Re: Strange date thing

Rene wrote:

> I was checking a date library and tested it against date.
> There is one thing I found
> date --date "19370701"
> returns
> Wed Jun 30 23:59:32 NST 1937


> I have been checking 37331 dates
> from date --date="19011216"
> .....
> to date --date="20040229"
> and only
> date --date "19370701"
> goes wrong.


Works here with /etc/localtime pointing to
/usr/share/zoneinfo/Europe/Berlin and an unset TZ variable. But:

# LC_ALL=C TZ=/usr/share/zoneinfo/Europe/Amsterdam date --date "19370701"
Wed Jun 30 23:59:32 NST 1937

I guessed your timezone from your mail address.

Time warp? Temporal discontinuity? Leap seconds?

Probably the time in the Netherlands was adjusted from one standard to
another standard in 1937.

Googling for "Europe/Amsterdam 1937" gives e.g.
<http://nssdcftp.gsfc.nasa.gov/usr/share/lib/zoneinfo/europe>,
which has:

# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Amsterdam 0:19:28 - LMT 1892 May
0:19:28 Neth %s 1937 Jul
0:20 Neth %s 1940 May 16 0:40
1:00 M-Eur MET%s 1945 Apr 2 2:00
1:00 Neth MET%s 1977
1:00 EU MET%s

"man zic" tells a bit about the format of that file . The time zone
input files probably come with glibc and are compiled with zic to
produce the files in /usr/share/lib/zoneinfo.

Regards...
Michael
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-21-2008, 09:37 AM
Sybren Stuvel
 
Posts: n/a
Default Re: Strange date thing

Rene enlightened us with:
> There is one thing I found
> date --date "19370701"
> returns
> Wed Jun 30 23:59:32 NST 1937


Same here, Europe/Amsterdam too.

Sybren
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-21-2008, 09:40 AM
wouter
 
Posts: n/a
Default Re: Strange date thing

same here, tz as Europe/Amsterdam gives wrong date. other tz's give
correct date (the one's i've checked that is)

wouter

Rene wrote:
> I was checking a date library and tested it against date.
> There is one thing I found
> date --date "19370701"
> returns
> Wed Jun 30 23:59:32 NST 1937
>
> I have been checking 37331 dates
> from date --date="19011216"
> .....
> to date --date="20040229"
> and only
> date --date "19370701"
> goes wrong.
>
> I have checked with the coreutils maintainer of which date is part and
> he couldn't reproduce it on his Debian machine
>
> I have been pooking around and see that after a call to mktime (in
> lib/getdate.c line 1302 coreutils 3.0.0 alpha) the tm structure is
> filled in with data that I wouldn't expect.
>
> I wonder is this specific for my machine. Not that it is a hugh problem
> and I can live with it (How many times are you interested in 1937-07-01)
> could someone see if it reproduce on his gentoo machine?
>
> Thanks Rene
>
> -----------------------software versions ----------------------------
> I'm using
> date --version
> date (coreutils) 5.2.1
>
> cat /proc/version
> Linux version 2.4.28 (root@win2k) (gcc version 3.3.5 (Gentoo Linux
> 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)) #17 Sun Mar 27 18:57:40 CEST 2005
>
> /lib/libc.so.6
> GNU C Library 20041102 release version 2.3.4, by Roland McGrath et al.
> Copyright (C) 2004 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.
> There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
> PARTICULAR PURPOSE.
> Compiled by GNU CC version 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3,
> pie-8.7.7.1).
> Compiled on a Linux 2.4.22 system on 2005-03-16.
> Available extensions:
> GNU libio by Per Bothner
> crypt add-on version 2.1 by Michael Glad and others
> linuxthreads-0.10 by Xavier Leroy
> The C stubs add-on version 2.1.2.
> GNU Libidn by Simon Josefsson
> BIND-8.2.3-T5B
> libthread_db work sponsored by Alpha Processor Inc
> NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
> Thread-local storage support included.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/libc/bugs.html>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-21-2008, 09:41 AM
Moe Trin
 
Posts: n/a
Default Re: Strange date thing

In article <4258e188$0$15601$e4fe514c@dreader16.news.xs4all.n l>, wouter wrote:

>Rene wrote:
>> I was checking a date library and tested it against date.
>> There is one thing I found
>> date --date "19370701"
>> returns
>> Wed Jun 30 23:59:32 NST 1937


>same here, tz as Europe/Amsterdam gives wrong date. other tz's give
>correct date (the one's i've checked that is)


I suspect this is something with the timezone file. If you grep for 1937
in the europe file (this happens to be from tzdata2005g file from March
ftp://elsie.nci.nih.gov/pub/tzdata2005g.tar.gz), you'd find

# 0:19:32.13 AMT NST Amsterdam, Netherlands Summer (1835-1937)*
# 0:20 NET NEST Netherlands (1937-1940)*

and

# Howse's statement is only correct up to 1909. From 1909-05-01 (00:00:00
# Amsterdam mean time) onwards, the whole of the Netherlands (including
# the Dutch railways) was required by law to observe Amsterdam mean time
# (19 minutes 32.13 seconds ahead of GMT). This had already been the
# common practice (except for the railways) for many decades but it was
# not until 1909 when the Dutch government finally defined this by law.
# On 1937-07-01 this was changed to 20 minutes (exactly) ahead of GMT and
# was generally known as Dutch Time ("Nederlandse Tijd").

Apparently, the change took effect at 23:40:28 GMT 30 June 1937. I suspect
this might be where your strange time is coming from.

Old guy

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-21-2008, 09:41 AM
wouter
 
Posts: n/a
Default Re: Strange date thing

man, are we Dutch crazy or what! i never knew about this. which is probably
a good thing otherwise i'd have emigrated already

Moe Trin wrote:
> I suspect this is something with the timezone file. If you grep for 1937
> in the europe file (this happens to be from tzdata2005g file from March
> ftp://elsie.nci.nih.gov/pub/tzdata2005g.tar.gz), you'd find
>
> # Howse's statement is only correct up to 1909. From 1909-05-01 (00:00:00
> # Amsterdam mean time) onwards, the whole of the Netherlands (including
> # the Dutch railways) was required by law to observe Amsterdam mean time
> # (19 minutes 32.13 seconds ahead of GMT). This had already been the
> # common practice (except for the railways) for many decades but it was
> # not until 1909 when the Dutch government finally defined this by law.
> # On 1937-07-01 this was changed to 20 minutes (exactly) ahead of GMT and
> # was generally known as Dutch Time ("Nederlandse Tijd").
>
> Apparently, the change took effect at 23:40:28 GMT 30 June 1937. I suspect
> this might be where your strange time is coming from.
>
> Old guy
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-21-2008, 09:41 AM
Moe Trin
 
Posts: n/a
Default Re: Strange date thing

In article <425aa8cc$0$179$e4fe514c@dreader5.news.xs4all.nl >, wouter wrote:

>man, are we Dutch crazy or what!


You really don't want me to try to answer that, do you? ;-)

>i never knew about this. which is probably a good thing otherwise i'd
>have emigrated already


The 19 minutes 32.13 seconds ahead of Greenwich translates to 4 degrees,
53 minutes 1.95 seconds of Longitude East, which puts it right around
Centraal Station in Amsterdam if my rather poor maps are to be believed.
The 20 minutes exactly, merely means exactly 5.000 degrees East which at
52 degrees 20 minutes North is about 7910 meters. And don't forget we're
talking about the Clarke 1866 spheroid, not the modern GPS coordinates.

At least your country is consistent. I'm in the state of Arizona, about
600 KM East of Los Angeles. Last Sunday morning, most of the USA went to
summer time - except for two states (Arizona and Indiana). In Arizona, we
don't do summer time, unless you are part of the Navajo Nation (the original
natives in 44000 square kilometers of the Northeast section of the state
who do use summer time), unless you are on the Hopi Indian Reservation (a
5250 square kilometer section right in the middle of the Navajo Nation)
because the Hopi don't use summer time, except for the 125 square kilometer
Najavo reservation at Jeddito within the Hopi Indian Reservation, where being
Navajo means they do use summer time... no, I'm not making this up.

The history of time can be very interesting, silly, and complex. The
several files that explain the timezones are worth a read when you have
time spare time to spend.

Old guy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-21-2008, 09:41 AM
wouter
 
Posts: n/a
Default Re: Strange date thing

Moe Trin wrote:
> In article <425aa8cc$0$179$e4fe514c@dreader5.news.xs4all.nl >, wouter wrote:
>
>
>>man, are we Dutch crazy or what!

> You really don't want me to try to answer that, do you? ;-)


i'd say everybody knows the answer to that anyway

> At least your country is consistent. I'm in the state of Arizona, about
> 600 KM East of Los Angeles. Last Sunday morning, most of the USA went to
> summer time - except for two states (Arizona and Indiana). In Arizona, we
> don't do summer time, unless you are part of the Navajo Nation (the original
> natives in 44000 square kilometers of the Northeast section of the state
> who do use summer time), unless you are on the Hopi Indian Reservation (a
> 5250 square kilometer section right in the middle of the Navajo Nation)
> because the Hopi don't use summer time, except for the 125 square kilometer
> Najavo reservation at Jeddito within the Hopi Indian Reservation, where being
> Navajo means they do use summer time... no, I'm not making this up.


omg! there wouldn't be a hopi reseveration within the jeddito reservation within
the hopi reservation within the navaho nation would there? <pant>

> The history of time can be very interesting, silly, and complex. The
> several files that explain the timezones are worth a read when you have
> time spare time to spend.


time is of the essence and has been an obsession of many in history.

this reminds me of a story i heard about a roadhouse along the south highway
through western australia. having no other settlements for a thousand kilometers
in either direction, they decided to create their own timezone 30 mins ahead
of Perth time, and 30 mins behind Adelaide time. just to make it easier

have you a source of other interesting time-facts maybe?

wouter
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-21-2008, 09:41 AM
Moe Trin
 
Posts: n/a
Default Re: Strange date thing

In article <42603006$0$158$e4fe514c@dreader12.news.xs4all.nl> , wouter wrote:

>omg! there wouldn't be a hopi reseveration within the jeddito reservation
>within the hopi reservation within the navaho nation would there? <pant>


Don't think so, but I'm sure the "local" cops have fun trying to figure
what time to put on the traffic tickets they write.

>time is of the essence and has been an obsession of many in history.


Why else do we have a complete news group just for the subject.

>this reminds me of a story i heard about a roadhouse along the south
>highway through western australia. having no other settlements for a
>thousand kilometers in either direction,


Nah, it just seems that bad.

> they decided to create their own timezone 30 mins ahead of Perth time, and
>30 mins behind Adelaide time. just to make it easier


Close. If you look in the 'australia' file that comes from nih.gov as part
of your timezone package, you will find this story, starting at about line
758. Look for the paragraph that has the word 'Madura' in it. Actually the
locals were pissed about the summer time as much as the two quite different
time offsets.

>have you a source of other interesting time-facts maybe?


See those zone files - there's all kinds of interesting stuff. I wasn't
actually aware of that story, but found it while looking at the file
trying to find the official time zone designations. The books that the
author uses look as if they have some interesting stuff too.

Old guy

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:05 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565