DateTime modify function not respect Time Zone
Đang mở
@derickr đang làm issue này rồi.
Từ ngày 1/7/2024.
Bug
Extension: date
Status: Verified
- Ngôn ngữ chính
- C
- Star
- 40.4k
- Fork
- 8.1k
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 96
Mô tả
Description
The following code:
<?php
var_dump((new DateTime())->modify("2024-06-21T13:03:20-04:00"));
Resulted in this output(php >=8.2.5; >=8.3.0):
object(DateTime)#1 (3) {
["date"]=>
string(26) "2024-06-21 13:03:20.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
But I expected this output instead(this works on php 8.2.4, 8.2.3, 8.2.2):
object(DateTime)#1 (3) {
["date"]=>
string(26) "2024-06-21 13:03:20.000000"
["timezone_type"]=>
int(1)
["timezone"]=>
string(6) "-04:00"
}
PHP Version
=8.2.5; >=8.3.0;
Operating System
Any Linux or Windows
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Đánh giá
Issue này chưa được đánh giá.