Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start of week for locale using Joda-Time

How do you determine which day of the week is considered the “start” according to a given Locale using Joda-Time?

Point: Most countries use the international standard Monday as first day of week (!). A bunch others use Sunday (notably USA). Others apparently Saturday. Some apparently Wednesday?!

Wikipedia "Seven-day week"#Week_number

like image 642
stolsvik Avatar asked Nov 26 '09 06:11

stolsvik


1 Answers

Joda-Time uses the ISO standard Monday to Sunday week.

It does not have the ability to obtain the first day of week, nor to return the day of week index based on any day other than the standard Monday. Finally, weeks are always calculated wrt ISO rules.

like image 65
JodaStephen Avatar answered Oct 17 '22 11:10

JodaStephen