Y2K BUG

Полезные советы, благоустройство и др.
PavelM
Уже с Приветом
Posts: 13316
Joined: 13 Jun 1999 09:01
Location: Yekaterinburg -> Montreal

Y2K BUG

Post by PavelM »

а у нас банк уже через интернет третий день как не работает [img:a6755a8942]http://www.privet.com/ubb/frown.gif[/img:a6755a8942]

кстати кто-нибудь слышал еще про такой изощренный баг 2000 года как наличие 54 недель в году (обычно 53)? такое бывает раз в 28 лет и я знаю людей которые поддерживая код находили связанные с этим проблемки ...
Joker
Уже с Приветом
Posts: 2180
Joined: 13 Aug 1999 09:01
Location: Tomsk, Russia --> Bay Area, CA, USA

Y2K BUG

Post by Joker »

А я думал, обычно 52... [img:7b7ace8b3b]http://www.privet.com/ubb/wink.gif[/img:7b7ace8b3b]
PavelM
Уже с Приветом
Posts: 13316
Joined: 13 Jun 1999 09:01
Location: Yekaterinburg -> Montreal

Y2K BUG

Post by PavelM »

Речь не о количестве недель как промежутков по 7 дней, а о количестве воскресений в году что важно для всяких бух.программ (расчет платежей и з/п например)


А вот где я это откопал: http://www.year2000.com

_______________________________________
54 Weeks in 2000: Another Y2K Problem!

by
Stan Sieler (sieler@allegro.com)
Michael Hensley (michaelh@allegro.com)
Barry Lake (barry@allegro.com)
Allegro Consultants, Inc. (http://www.allegro.com)

Many software applications define a week-of-year, which is used for a variety of purposes. Usually, such weeks are defined as starting on Sunday and ending on Saturday. (These week-of-years are sometimes called "fiscal week" or "calendar week.")

A normal year has 53 weeks, where 51 or 52 are "complete" weeks, and 2 or 1 are "incomplete" (because they start or finish in the prior or following year).

For example, 1999 has 53 weeks. The first week has two days in 1999 (Friday, January 1 and Saturday, January 2). The last week has six days in 1999 (Sunday, December 26 through Friday, December 31).

If there were only 364 days in a year, and if the year started on a Sunday, then it would have exactly 52 weeks. However, we aren't that lucky, and no year ever has fewer than 53 weeks.

The year 2000, as fate would have it, has 54 weeks! The first week has one day in 2000 (Saturday, January 1), and the 54th week has one day (Sunday, December 31).

It turns out that a 54-week year happens once every 28 years, so the last time was 1972 ... well before the birth of many software packages now in common use.

This wouldn't be a problem if programmers had been aware of it, but we've seen a number of programs that assume that the number of weeks in a year is always 53. This can cause two kinds of problems:


invalid restrictions on data entry;
We have seen code that checks user-entered week numbers, incorrectly restricting them to the range 1..53. These programs would prevent the user from entering a week number of 54.


run time aborts
If the code is written in range-checking language (e.g., Pascal), or if it uses the week number as an index into an array of 53 elements, the program could abort, or (even worse) possibly pickup incorrect information and continue running.

This isn't just a theoretical problem, of course ... we encountered it in code we started to maintain for one of our customers. The team that foundand characterized this problem was Barry Lake and Michael Hensley.

--------------------------------------------------------------------------------

(Company background: Allegro Consultants, Inc., has been working on Y2K issues for many years...we wrote the internal white paper HP used for the start of their Y2K efforts in HP-UX and MPE/iX. We also wrote "HourGlass 2000 for the HP 3000" and "HourGlass 2000 for the HP 9000," two date/time simulator tools.)


--------------------------------------------------------------------------------


To the Year 2000 Information Center™
Joker
Уже с Приветом
Posts: 2180
Joined: 13 Aug 1999 09:01
Location: Tomsk, Russia --> Bay Area, CA, USA

Y2K BUG

Post by Joker »

Вот теперь понятно, так бы сразу и излагал [img:32c0c83ccd]http://www.privet.com/ubb/smile.gif[/img:32c0c83ccd]
Суда по описанию, это баг 3-го уровня, то есть связанный с прикладным софтом. Тут рецептом может быть только правка кода... Можно посмотреть поглубже, что MS пишет по этому поводу, но, честно говоря ломает. Если нужно, я покопаюсь...

Return to “Прочее”