php / php/php-src

Add `V` format specifier for formatting and `createFromFormat`

Đang mở
#13,747 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@derickr đang làm issue này rồi.

Từ ngày 18/3/2024.

Extension: date Feature Status: Needs Triage
Ngôn ngữ chính
C
Star
40.4k
Fork
8.2k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
103

Mô tả

Description

The following code:

<?php
$t = microtime(true);
$now = DateTime::createFromFormat('U.u', $t);
?>

Can fail, in case $t does only contain full seconds. Add V to allow for parsing any seconds + fraction of seconds, as well as add V to DateTimeInterface::format to reproduce the same value.

This would also allow for accepting any microtime(true) output.

PHP Version

PHP 8.3.3

Operating System

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.