PHP 8.3.4 Released!

IntlCalendar::getTime

(PHP 5 >= 5.5.0, PHP 7, PHP 8, PECL >= 3.0.0a1)

IntlCalendar::getTimeObtiene el tiempo representado por el objeto

Descripción

Estilo orientado a objetos

public IntlCalendar::getTime(): float

Estilo por procedimientos

intlcal_get_time(IntlCalendar $cal): float

Devuelve el tiempo en milisegundos asociado al objeto desde el tiempo Unix.

Parámetros

cal

El recurso IntlCalendar.

Valores devueltos

Un float represendando el número de milisegundos transcurridos desde el tiempo de referencia (1 Jan 1970 00:00:00 UTC).

Ejemplos

Ejemplo #1 IntlCalendar::getTime()

<?php
ini_set
('date.timezone', 'Europe/Lisbon');
ini_set('intl.default_locale', 'en_US');

$cal = new IntlGregorianCalendar(2013, 4 /* May */, 1, 0, 0, 0);
$time = $cal->getTime();
var_dump($time, $time / 1000 == strtotime('2013-05-01 00:00:00')); //true

El resultado del ejemplo sería:

float(1367362800000)
bool(true)

Ver también

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top