You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by uwegeercken <uw...@swissport.com> on 2011/10/31 10:25:32 UTC

wrong week number

I have a strange problem and don't know what the cause could be, so I hope
somebody can help me.

I am using ant for a few years now without problems. now I have to migrate
one job to a different machine.

the old machine is a windows 2003 server with ant 1.6.5. the new machine is
a redhat 64bit server with ant 1.8.2

now when I run the job I calculate the current week. strange is, that on the
old windows machine it gives me week=44 and on the new machine it give me
week=45

here is the code:

 <tstamp>
                       <format property="weeknumber" pattern="ww"/>
                        <format property="yearnumber" pattern="yyyy"/>
                        <format property="monthnumber" pattern="MM"/>
                        <format property="daynumber" pattern="dd"/>
                </tstamp>


the date on both machines: Mon Oct 31 10:17:21 CET 2011 

I can not think of what the problem could be. and would appreciate any help.

thanks,

uwe

--
View this message in context: http://ant.1045680.n5.nabble.com/wrong-week-number-tp4951923p4951923.html
Sent from the Ant - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: wrong week number

Posted by uwegeercken <uw...@swissport.com>.
hello,

thanks for the tip. I have set the servers locale to a different one now. interesting enough, when I run the ant task from the console, it works now. but when cron runs the job, it calculates the wrong week. so I assume that cron (still) uses the wrong locale.

when I enter "locale" on the command line, then I still get the en_GB locale displayed although I change it to de_CH using "system-config-language". maybe a reboot is required.

rgds,

uwe

Uwe Geercken
Swissport International Ltd. Station Zurich
Phone

+41 43 81 25459



From: Stefan Bodewig [via Ant] [mailto:ml-node+s1045680n4954334h12@n5.nabble.com]
Sent: Dienstag, November 01, 2011 06:39
To: Geercken Uwe
Subject: Re: wrong week number

On 2011-10-31, uwegeercken wrote:

> now when I run the job I calculate the current week. strange is, that on the
> old windows machine it gives me week=44 and on the new machine it give me
> week=45

Different locales?  Calendar week[1] is not a global concept but depends
on the country.

Stefan

[1] as well as the question on which day a week starts

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]</user/SendEmail.jtp?type=node&node=4954334&i=0>
For additional commands, e-mail: [hidden email]</user/SendEmail.jtp?type=node&node=4954334&i=1>


________________________________
If you reply to this email, your message will be added to the discussion below:
http://ant.1045680.n5.nabble.com/wrong-week-number-tp4951923p4954334.html
To unsubscribe from wrong week number, click here<http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4951923&code=dXdlLmdlZXJja2VuQHN3aXNzcG9ydC5jb218NDk1MTkyM3wtOTgyNTU5MTQw>.


--
View this message in context: http://ant.1045680.n5.nabble.com/wrong-week-number-tp4951923p4954588.html
Sent from the Ant - Users mailing list archive at Nabble.com.

Re: wrong week number

Posted by Stefan Bodewig <bo...@apache.org>.
On 2011-10-31, uwegeercken wrote:

> now when I run the job I calculate the current week. strange is, that on the
> old windows machine it gives me week=44 and on the new machine it give me
> week=45

Different locales?  Calendar week[1] is not a global concept but depends
on the country.

Stefan

[1] as well as the question on which day a week starts

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: wrong week number

Posted by uwegeercken <uw...@swissport.com>.
my new server was configured with following locale:

LANG=en_GB.utf8
LC_CTYPE="en_GB.utf8"
LC_NUMERIC="en_GB.utf8"
LC_TIME="en_GB.utf8"
LC_COLLATE="en_GB.utf8"
LC_MONETARY="en_GB.utf8"
LC_MESSAGES="en_GB.utf8"
LC_PAPER="en_GB.utf8"
LC_NAME="en_GB.utf8"
LC_ADDRESS="en_GB.utf8"
LC_TELEPHONE="en_GB.utf8"
LC_MEASUREMENT="en_GB.utf8"
LC_IDENTIFICATION="en_GB.utf8"
LC_ALL=

I changed it with the command: system-config-language to the de_CH locale,
and now it suddenly works. 

I did not assume that the englisch locale (GB) would make such a difference
in the calculation of the week, but anyway, it works now.

rgds,

uwe

--
View this message in context: http://ant.1045680.n5.nabble.com/wrong-week-number-tp4951923p4954564.html
Sent from the Ant - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org