2009-04-07 12 views

risposta

10

Da CLDR di 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)" /> 

(Territorio 001 è "Mondo")

+0

Questo è molto utile. Grazie per aver postato questo. – Calvin

4

eseguire questo comando nella shell (bash o sh o ecc):

locale first_weekday 

In PHP , chiama un processo per eseguire questo comando in sh e ottenere l'output. In Python, mi fa una cosa del genere:

def getLocaleFirstWeekDay(): 
    return int(os.popen('locale first_weekday').read())-1 
+0

Non funziona su OSX, anche se –

+0

PHP dovrebbe funzionare con 'intlcal_get_first_day_of_week (intlcal_create_instance())', anch'esso che non richiede la foratura di un altro processo. Tuttavia, vedere https://bugs.php.net/bug.php?id=76073 –

Problemi correlati