Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Sunday: Day_Of_Week issue
 Post subject: Sunday: Day_Of_Week issue Post rating: 0   New post Posted: Wed 20 Jan, 2010, 17:20 

User rating: 0
Joined: Mon 04 Jan, 2010, 19:56
Posts: 9
I use the following lines to get the DayOfWeek information.

Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(tick.getTime());
dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);

Everything works fine until Sunday. During the Sunday bar (21.00-23.59) the dayOfWeek is displayed as 6 which corresponds to Friday. Why is that?


 
 Post subject: Re: Sunday: Day_Of_Week issue Post rating: 0   New post Posted: Thu 21 Jan, 2010, 10:41 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
If you need day of week in GMT zone, then you should use Calendar.getInstance(TimeZone.getTimeZone("GMT")). This doesn't explain why you getting Friday at Sunday though. Check what time are you setting in cal.setTimeInMillis(tick.getTime());


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com