Salut.
Nu stiu daca e o problema adevarata sau gresesc eu undeva ...
Cum se calculeaza nr de ordine al saptamanii intr`un an,
al unei date(timestamp) anumite ?
de ex la mine:
teste=# select to_char(date('14-Jan-2002'), 'WW');
to_char
---------
02
(1 row)
teste=# select to_char(date('15-Jan-2002'), 'WW');
to_char
---------
02
(1 row)
Asta pare a fi bine ...
pe un postgresqsl mai vechi imi raporta ``02'' si respectiv ``04'' ...
In specificatia ISO scria ceva de genu:
``
An ordinal date is identified by a given day in a given year. A week is identified by
its number in a given year. A week
begins with a Monday, and the first week of a year is the one which includes the
first Thursday, or equivalently the one
which includes January 4. Midnight may be expressed as either 00:00:00 or 24:00:00.
Unless otherwise stated, all values are fixed width, with leading zeros used when
necessary to pad out a value. Many
formats can be given in either a ``basic format'' or an ``extended format'', where
the extended format has additional
separation characters between values. Characters are taken from ISO 646. Some
formats require alphabetic letters, which
should be upper case, although lower case may be used if upper case is not
available.
In this paper, the date/time 14 February 1993, 13:10:30 (ten minutes and thirty
seconds past one pm) is used to
demonstrate formats. The ordinal day number is 045 and the week number is 06. The
day number within the week is 7.
''
la mine ... :
teste=# select to_char(date('14-Feb-1993'), 'WW');
to_char
---------
07
(1 row)
deci nu 06 cum trebuia ...
unde ar fi `greseala' ?
Merci mult!
Bogdan M.
---
Send e-mail to '[EMAIL PROTECTED]' with 'unsubscribe rlug' to
unsubscribe from this list.