推荐 最新
兰豆儿

求时区国际化方案?

求时间根据timezone国际化的开源demo,类似飞书这种的,考虑【冬令时】和【夏令时】的 https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241024/c213c905eebfc9a6291edd0ac4eaf8f5.png 提供开源demo,或者前后端思路

0
1
0
浏览量16
PunkMaccccc

PHP strtotime函数与时区问题?

我在使用PHP strtotime函数是,遇到了+9时区的问题。 $first_day = strtotime($year.'-'.$i.'-01 00:00:00'); return json($first_day); 得到的结果是 2024-01-01 09:00:00 请问到底该怎么解决才能使 strtotime 直接得到0点的时间戳? 我检查了系统的时区,timedatectl 返回的结果 Local time: Wed 2024-01-03 22:15:09 CST Universal time: Wed 2024-01-03 14:15:09 UTC RTC time: Wed 2024-01-03 14:15:09 Time zone: Asia/Shanghai (CST, +0800) System clock synchronized: yes NTP service: active RTC in local TZ: no PHP date_default_timezone_get() 返回的是PRC。 即便使用 DateTime 得到的依然是2024-01-01 09:00:00。 new DateTime($year.'-'.$i.'-01', new DateTimeZone('Asia/Shanghai'));

0
1
0
浏览量20