A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 yearHow do I get the first day of the week for the current locale? (PHP / L8N) - page 1
User InfoPosts
How do I get the first day of the week for the current locale? (PHP / L8N)#1
In most locale, the first day of the week is Monday. In the US (and presumably elsewhere), the week starts on Sunday.

How can find out in PHP, for an arbitrary locale, the current setting for the first day of the week (Sunday or Monday)?

posted date: 2009-04-07 12:33:00


Re: How do I get the first day of the week for the current locale? (PHP / L8N)#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-07 12:33:01


Re: How do I get the first day of the week for the current locale? (PHP / L8N)#3
From CLDR(s supplemental data:<firstDay day="mon" territories="001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK" /><firstDay day="fri" territories="BD MV" /><firstDay day="sat" territories="AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY" /><firstDay day="sun" territories="AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW" /><firstDay day="sun" territories="GB" alt="variant" references="Shorter Oxford Dictionary (5th edition, 2002)" />(Territory 001 is "World")

posted date: 2009-04-07 12:51:00


Re: How do I get the first day of the week for the current locale? (PHP / L8N)#4
That's quite useful. Thank you for posting that.

posted date: 2009-04-07 16:41:00


Re: How do I get the first day of the week for the current locale? (PHP / L8N)#5
Run this command in the shell (bash or sh or etc):locale first_weekdayIn PHP, call a process to run this command in sh, and get it(s output.In Python, I does a thing like this:def getLocaleFirstWeekDay(): return int(os.popen((locale first_weekday().read())-1

posted date: 2009-09-16 19:38:00


select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.