|
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 |
[Oliver]
|
Post subject: Sunday: Day_Of_Week issue |
Post rating: 0
|
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?
|
|
|
|
 |
API Support
|
Post subject: Re: Sunday: Day_Of_Week issue |
Post rating: 0
|
Posted: Thu 21 Jan, 2010, 10:41
|
|
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());
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|