Hi,
I asked about it on HSQLDB forum, and in latest snapshot of 2.0. works
correctly.
I get answers, I can not do with it:
SELECT EXTRACT ( WEEK_OF_YEAR FROM DATE'2009-12-31') FROM "Table" /* return 53
*/
This function uses a Java extract function internally.
// uses Calendar.WEEK_OF_YEAR to call the function below, in
org.hsqldb.HsqlDateTime
final static Calendar tempCalGMT = new
GregorianCalendar(TimeZone.getTimeZone("GMT"));
public static int getDateTimePart(long m, int part) {
synchronized (tempCalGMT) {
tempCalGMT.setTimeInMillis(m);
return tempCalGMT.get(part);
}
}
The way get(part) works depends on the user's locale, and in this case, it is
not "correct" for you.
You need to do some tests with Java and let me know what setting for the
Calandar object works correctly in your Locale.
Another post:
In the latest SVN and snapshot jars, the locale for GB is used for the
Calendar objects and this function should report uniformly regardless of your
locale.
It is solved for 2.0 but I not see solution for 1.8 versions.
Thanks,
Zoltan
Ezzel a dátummal: Monday 08 February 2010 13.58.31 Reizinger Zoltán ezt írta:
> Hi all,
>
> I use odb file with HSQLDB (1.8.0.10), with any version of OOo, and java
> 1.6.0_18. (Tested in 3.2RC5, and 3.1.1, and hsqldb19 on linux, and in 3.0.0
> in in Vista(HU version:).
>
> The queries gives wrong value, if I compare to my Kmail or paper calendar,
> on linux with HU locale.
>
> SELECT WEEK('2010-01-01') FROM "Table"gives 1 instead of 53
> SELECT WEEK(CURRENT_DATE') FROM "Table" gives 7 instead of 6.
>
> If I use in postgres:
> SELECT EXTRACT(WEEK FROM TIMESTAMP '2010-01-01 00:00:00'); I get 53.
>
> In MYSQL:
> SELECT WEEK('2010-01-01') gives 0.
> SELECT WEEK(CURRENT_DATE) gives 6.
>
> In HSQLDB 2.0.0RC8, in cws hsqldb19 version:
> SELECT EXTRACT( WEEK_OF_YEAR FROM CURRENT_DATE ) FROM "Table" gives 7.
>
> The all HSQLDB gives wrong results, for this years week number.
> What can I do?
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]