Hướng dẫn php dateinterval to seconds - php dateinterval thành giây

Vì vậy, tôi cơ sở hai ngày:

$d = $start->diff[$end];

Và bây giờ tôi muốn nhận ngày tính bằng giây [không phải tham số second]. Tôi biết nó có thể được thực hiện với chức năng PHP gốc - nhưng nó chỉ hoạt động trên 1970. Tôi biết tôi phải hoạt động bằng cách nào đó với phương pháp

$seconds = $d->s + [$d->i * 60] + [$d->h * 3600] + [$d->d * 86400] + [$d->m * 2592000]; // and so on
0, nhưng tôi không hiểu ...

Đã hỏi ngày 3 tháng 12 năm 2014 lúc 17:22Dec 3, 2014 at 17:22

John Smithjohn SmithJohn Smith

6.91512 Huy hiệu vàng63 Huy hiệu bạc117 Huy hiệu đồng12 gold badges63 silver badges117 bronze badges

4

Bạn có thể truy cập các thuộc tính công khai của lớp

$seconds = $d->s + [$d->i * 60] + [$d->h * 3600] + [$d->d * 86400] + [$d->m * 2592000]; // and so on
1 và thực hiện một số toán học về nó:

$seconds = $d->s + [$d->i * 60] + [$d->h * 3600] + [$d->d * 86400] + [$d->m * 2592000]; // and so on

Nhưng một khi chúng ta bước vào tháng, sẽ có phương sai +/- 2 ngày trừ khi chúng ta tuân thủ định nghĩa tùy ý là một tháng là

$seconds = $d->s + [$d->i * 60] + [$d->h * 3600] + [$d->d * 86400] + [$d->m * 2592000]; // and so on
2 [30 ngày].

Bạn cũng có thể sử dụng sự khác biệt của hai dấu thời gian Unix từ các đối tượng DateTime [nhưng cuối cùng bạn sẽ gặp vấn đề với ngày ít hơn năm 1970]:

$seconds = $end->getTimestamp[] - $start->getTimestamp[];

Đã trả lời ngày 3 tháng 12 năm 2014 lúc 18:31Dec 3, 2014 at 18:31

7

Những điều sau đây dường như hoạt động, mặc dù tôi cảm thấy nên có một cách tốt hơn.

$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;

Và vâng, nó dường như đang làm việc cho ngày sớm hơn

$seconds = $d->s + [$d->i * 60] + [$d->h * 3600] + [$d->d * 86400] + [$d->m * 2592000]; // and so on
3.

Đã trả lời ngày 3 tháng 12 năm 2014 lúc 18:33Dec 3, 2014 at 18:33

Pradeepceppradeepcetpradeepcep

8332 Huy hiệu vàng8 Huy hiệu bạc22 Huy hiệu đồng2 gold badges8 silver badges22 bronze badges

4

Làm thế nào về việc sử dụng một lớp DateTime / DateTimeIMmutable để tạo phiên bản DateTime hiện tại, sau đó thêm DateInterVal $ D của bạn bằng cách sử dụng phương thức Thêm [], sau đó sử dụng phương thức GetTimestamp [].

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[]

Để có được số giây kể từ bây giờ, chỉ cần trừ thời gian [].

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]

Đã trả lời ngày 25 tháng 10 năm 2020 lúc 16:27Oct 25, 2020 at 16:27

11 năm trước

Quản trị viên tại Torntech dot comCreates a new DateInterval object

Sự mô tả

Chỉ

$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
5 đến
$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
6,
$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
7 và
$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
8 sẽ được nhìn thấy, bao gồm một tài sản boolean
$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
9 mới. DateInterval::__construct[string
$seconds = $d->s + [$d->i * 60] + [$d->h * 3600] + [$d->d * 86400] + [$d->m * 2592000]; // and so on
4
]

$seconds = $end->getTimestamp[] - $start->getTimestamp[];
2 có thể được kết hợp với
$seconds = $end->getTimestamp[] - $start->getTimestamp[];
1.

Ví dụ

Ví dụ #1 Xây dựng và sử dụng các đối tượng DateInterVal

Ví dụ trên sẽ xuất ra:

Ví dụ #2 ví dụĐầu ra của ví dụ trên trong Php 8.2:Sự mô tả
Chỉ
$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
5 đến
$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
6,
$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
7 và
$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
8 sẽ được nhìn thấy, bao gồm một tài sản boolean
$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
9 mới.
$seconds = $end->getTimestamp[] - $start->getTimestamp[];
2 có thể được kết hợp với
$seconds = $end->getTimestamp[] - $start->getTimestamp[];
1.
Ví dụVí dụ #1 Xây dựng và sử dụng các đối tượng DateInterVal
Ví dụ trên sẽ xuất ra:Ví dụ #2 ví dụ
Đầu ra của ví dụ trên trong Php 8.2:Đầu ra của ví dụ trên trong Php 8:
Đầu ra của ví dụ trên trong Php 7:Xem thêm
Ví dụVí dụ #1 Xây dựng và sử dụng các đối tượng DateInterVal
Ví dụ trên sẽ xuất ra:Ví dụ #2 ví dụ

Đầu ra của ví dụ trên trong Php 8.2:

Ghi chú::

Các loại đơn vị phải được nhập từ đơn vị tỷ lệ lớn nhất ở bên trái đến đơn vị tỷ lệ nhỏ nhất ở bên phải. Vì vậy, nhiều năm trước nhiều tháng, nhiều tháng trước ngày, ngày trước vài phút, v.v. Do đó, một năm và bốn ngày phải được biểu diễn là

$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
0, không phải
$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
1.

Các đặc điểm kỹ thuật cũng có thể được biểu diễn dưới dạng thời gian ngày. Một mẫu của một năm và bốn ngày sẽ là

$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
2. Nhưng các giá trị trong định dạng này không thể vượt quá điểm cuộn của một khoảng thời gian nhất định [ví dụ:
$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
3 giờ là không hợp lệ].

Các định dạng này dựa trên đặc tả thời lượng ISO 8601.

Errors/Exceptions

Ném một ngoại lệ khi

$seconds = $d->s + [$d->i * 60] + [$d->h * 3600] + [$d->d * 86400] + [$d->m * 2592000]; // and so on
5 không thể được phân tích cú pháp như một khoảng.Exception when the
$seconds = $d->s + [$d->i * 60] + [$d->h * 3600] + [$d->d * 86400] + [$d->m * 2592000]; // and so on
5 cannot be parsed as an interval.

Thay đổi

Phiên bảnSự mô tả
8.2.0 Chỉ
$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
5 đến
$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
6,
$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
7 và
$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
8 sẽ được nhìn thấy, bao gồm một tài sản boolean
$dateIntrvl = $start->diff[$end];

$days = $dateIntrvl->format['%a'];
$hours = $dateIntrvl->format['%h'];
$mins = $dateIntrvl->format['%i'];
$secs = $dateIntrvl->format['%s'];

$totalSeconds = [$days * 24 * 60 * 60] + [$hours * 60 * 60] + [$mins * 60] + $secs;
9 mới.
8.0.0
$seconds = $end->getTimestamp[] - $start->getTimestamp[];
2 có thể được kết hợp với
$seconds = $end->getTimestamp[] - $start->getTimestamp[];
1.

Ví dụ

Ví dụ #1 Xây dựng và sử dụng các đối tượng DateInterValDateInterval objects

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[]
2

Ví dụ trên sẽ xuất ra:

Ví dụ #2 ví dụDateInterval example

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[]
3

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[]
4

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[]
5

Đầu ra của ví dụ trên trong Php 8.2:

object[DateInterval]#1 [10] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[9]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["from_string"]=>
  bool[false]
}

Đầu ra của ví dụ trên trong Php 8:

object[DateInterval]#1 [16] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[9]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["weekday"]=>
  int[0]
  ["weekday_behavior"]=>
  int[0]
  ["first_last_day_of"]=>
  int[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["special_type"]=>
  int[0]
  ["special_amount"]=>
  int[0]
  ["have_weekday_relative"]=>
  int[0]
  ["have_special_relative"]=>
  int[0]
}

Đầu ra của ví dụ trên trong Php 7:

object[DateInterval]#1 [16] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[2]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["weekday"]=>
  int[0]
  ["weekday_behavior"]=>
  int[0]
  ["first_last_day_of"]=>
  int[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["special_type"]=>
  int[0]
  ["special_amount"]=>
  int[0]
  ["have_weekday_relative"]=>
  int[0]
  ["have_special_relative"]=>
  int[0]
}

Xem thêm

  • DateInterval :: định dạng [] - định dạng khoảng thời gian
  • DateTime :: add [] - Sửa đổi một đối tượng DateTime, với số lượng ngày, tháng, năm, giờ, phút và giây
  • DateTime :: sub [] - trừ một số ngày, tháng, năm, giờ, phút và giây từ một đối tượng DateTime
  • DateTime :: Diff [] - Trả về sự khác biệt giữa hai đối tượng DateTime

Owen tại niềm tin.com

9 năm trước

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[]
6

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[]
7

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[]
8

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[]
9

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
0

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
1

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
2

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
3

Buvinghausen tại Gmail Dot Com ¶

10 năm trước

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
4

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
5

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
3

Hernanibus ¶

5 năm trước

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
7

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
8

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
9

object[DateInterval]#1 [10] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[9]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["from_string"]=>
  bool[false]
}
0

object[DateInterval]#1 [10] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[9]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["from_string"]=>
  bool[false]
}
1

object[DateInterval]#1 [10] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[9]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["from_string"]=>
  bool[false]
}
2

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
3

Daniellehr tại gmx dot de ¶

10 năm trước

object[DateInterval]#1 [10] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[9]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["from_string"]=>
  bool[false]
}
4

object[DateInterval]#1 [10] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[9]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["from_string"]=>
  bool[false]
}
5

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
3

Hernanibus ¶

5 năm trước

object[DateInterval]#1 [10] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[9]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["from_string"]=>
  bool[false]
}
7

object[DateInterval]#1 [10] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[9]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["from_string"]=>
  bool[false]
}
8

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
3

Daniellehr tại gmx dot de ¶

kuzb ¶

object[DateInterval]#1 [16] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[9]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["weekday"]=>
  int[0]
  ["weekday_behavior"]=>
  int[0]
  ["first_last_day_of"]=>
  int[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["special_type"]=>
  int[0]
  ["special_amount"]=>
  int[0]
  ["have_weekday_relative"]=>
  int[0]
  ["have_special_relative"]=>
  int[0]
}
0

object[DateInterval]#1 [16] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[9]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["weekday"]=>
  int[0]
  ["weekday_behavior"]=>
  int[0]
  ["first_last_day_of"]=>
  int[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["special_type"]=>
  int[0]
  ["special_amount"]=>
  int[0]
  ["have_weekday_relative"]=>
  int[0]
  ["have_special_relative"]=>
  int[0]
}
1

object[DateInterval]#1 [16] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[9]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["weekday"]=>
  int[0]
  ["weekday_behavior"]=>
  int[0]
  ["first_last_day_of"]=>
  int[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["special_type"]=>
  int[0]
  ["special_amount"]=>
  int[0]
  ["have_weekday_relative"]=>
  int[0]
  ["have_special_relative"]=>
  int[0]
}
2

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
3

11 năm trước

5 năm trước

object[DateInterval]#1 [16] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[9]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["weekday"]=>
  int[0]
  ["weekday_behavior"]=>
  int[0]
  ["first_last_day_of"]=>
  int[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["special_type"]=>
  int[0]
  ["special_amount"]=>
  int[0]
  ["have_weekday_relative"]=>
  int[0]
  ["have_special_relative"]=>
  int[0]
}
4

object[DateInterval]#1 [16] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[9]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["weekday"]=>
  int[0]
  ["weekday_behavior"]=>
  int[0]
  ["first_last_day_of"]=>
  int[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["special_type"]=>
  int[0]
  ["special_amount"]=>
  int[0]
  ["have_weekday_relative"]=>
  int[0]
  ["have_special_relative"]=>
  int[0]
}
5

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
3

Daniellehr tại gmx dot de ¶

kuzb ¶

object[DateInterval]#1 [16] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[9]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["weekday"]=>
  int[0]
  ["weekday_behavior"]=>
  int[0]
  ["first_last_day_of"]=>
  int[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["special_type"]=>
  int[0]
  ["special_amount"]=>
  int[0]
  ["have_weekday_relative"]=>
  int[0]
  ["have_special_relative"]=>
  int[0]
}
7

object[DateInterval]#1 [16] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[9]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["weekday"]=>
  int[0]
  ["weekday_behavior"]=>
  int[0]
  ["first_last_day_of"]=>
  int[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["special_type"]=>
  int[0]
  ["special_amount"]=>
  int[0]
  ["have_weekday_relative"]=>
  int[0]
  ["have_special_relative"]=>
  int[0]
}
8

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
3

11 năm trước

10 năm trước

object[DateInterval]#1 [16] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[2]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["weekday"]=>
  int[0]
  ["weekday_behavior"]=>
  int[0]
  ["first_last_day_of"]=>
  int[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["special_type"]=>
  int[0]
  ["special_amount"]=>
  int[0]
  ["have_weekday_relative"]=>
  int[0]
  ["have_special_relative"]=>
  int[0]
}
0

object[DateInterval]#1 [16] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[2]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["weekday"]=>
  int[0]
  ["weekday_behavior"]=>
  int[0]
  ["first_last_day_of"]=>
  int[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["special_type"]=>
  int[0]
  ["special_amount"]=>
  int[0]
  ["have_weekday_relative"]=>
  int[0]
  ["have_special_relative"]=>
  int[0]
}
1

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
3

Hernanibus ¶

5 năm trước

object[DateInterval]#1 [16] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[2]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["weekday"]=>
  int[0]
  ["weekday_behavior"]=>
  int[0]
  ["first_last_day_of"]=>
  int[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["special_type"]=>
  int[0]
  ["special_amount"]=>
  int[0]
  ["have_weekday_relative"]=>
  int[0]
  ["have_special_relative"]=>
  int[0]
}
3

object[DateInterval]#1 [16] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[2]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["weekday"]=>
  int[0]
  ["weekday_behavior"]=>
  int[0]
  ["first_last_day_of"]=>
  int[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["special_type"]=>
  int[0]
  ["special_amount"]=>
  int[0]
  ["have_weekday_relative"]=>
  int[0]
  ["have_special_relative"]=>
  int[0]
}
4

object[DateInterval]#1 [16] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[2]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["weekday"]=>
  int[0]
  ["weekday_behavior"]=>
  int[0]
  ["first_last_day_of"]=>
  int[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["special_type"]=>
  int[0]
  ["special_amount"]=>
  int[0]
  ["have_weekday_relative"]=>
  int[0]
  ["have_special_relative"]=>
  int[0]
}
5

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
3

Daniellehr tại gmx dot de ¶

kuzb ¶

object[DateInterval]#1 [16] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[2]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["weekday"]=>
  int[0]
  ["weekday_behavior"]=>
  int[0]
  ["first_last_day_of"]=>
  int[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["special_type"]=>
  int[0]
  ["special_amount"]=>
  int[0]
  ["have_weekday_relative"]=>
  int[0]
  ["have_special_relative"]=>
  int[0]
}
7

object[DateInterval]#1 [16] {
  ["y"]=>
  int[0]
  ["m"]=>
  int[0]
  ["d"]=>
  int[2]
  ["h"]=>
  int[0]
  ["i"]=>
  int[0]
  ["s"]=>
  int[0]
  ["f"]=>
  float[0]
  ["weekday"]=>
  int[0]
  ["weekday_behavior"]=>
  int[0]
  ["first_last_day_of"]=>
  int[0]
  ["invert"]=>
  int[0]
  ["days"]=>
  bool[false]
  ["special_type"]=>
  int[0]
  ["special_amount"]=>
  int[0]
  ["have_weekday_relative"]=>
  int[0]
  ["have_special_relative"]=>
  int[0]
}
8

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
3

11 năm trước

Quản trị viên tại Torntech dot com

second0

second1

second2

second3

second4

7 năm trước

Kevinpeno tại Gmail Dot Com ¶

second5

second6

second7

second8

UserExampleCom tại mailinator dot com ¶

kuzb ¶

second9

$seconds = $d->s + [$d->i * 60] + [$d->h * 3600] + [$d->d * 86400] + [$d->m * 2592000]; // and so on
00

[new \DateTimeImmutable[]]->add[$d]->getTimestamp[] - \time[]
3

Bài Viết Liên Quan

Chủ Đề