沃梦达 / 编程问答 / php问题 / 正文

如何获得当前语言环境的一周的第一天?(PHP/L8N)

How do I get the first day of the week for the current locale? (PHP / L8N)(如何获得当前语言环境的一周的第一天?(PHP/L8N))

本文介绍了如何获得当前语言环境的一周的第一天?(PHP/L8N)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在大多数地区,一周的第一天是星期一.在美国(可能还有其他地方),这一周从星期日开始.

In most locale, the first day of the week is Monday. In the US (and presumably elsewhere), the week starts on Sunday.

如何在 PHP 中找到任意语言环境下一周第一天(星期日或星期一)的当前设置?

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

推荐答案

来自 CLDR 的 补充数据(2019 年 10 月第 36 版):

From CLDR's supplemental data (release 36, October 2019):

<firstDay day="mon" territories="001 AD AI AL AM AN AR 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 IE IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO NZ PL RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK"/>
<firstDay day="fri" territories="MV"/>
<firstDay day="sat" territories="AE AF BH DJ DZ EG IQ IR JO KW LY OM QA SD SY"/>
<firstDay day="sun" territories="AG AS AU BD BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP PA PE PH PK PR PT PY SA SG SV TH TT TW UM US VE VI WS YE ZA ZW"/>

<firstDay day="sun" territories="GB" alt="variant" references="Shorter Oxford Dictionary (5th edition, 2002)"/>

(领土 001 是 UN M49 区号世界")

(territory 001 is the UN M49 area code for "World")

这篇关于如何获得当前语言环境的一周的第一天?(PHP/L8N)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何获得当前语言环境的一周的第一天?(PHP/L8N)

基础教程推荐