Introducción
PHP Manual
PHP Manual»MongoDB\BSON»MongoDB\BSON\UTCDateTime

La clase MongoDB\BSON\UTCDateTime

(mongodb >=1.0.0)

Representa una » fecha BSON. El valor es un entero de 64 bits que representa el número de milisegundos transcurridos desde la época Unix (1 de enero de 1970). Los valores negativos representan fechas anteriores a 1970.

final class MongoDB\BSON\UTCDateTime implements MongoDB\BSON\UTCDateTimeInterface, MongoDB\BSON\Type, JsonSerializable, Stringable {
/* Métodos */
final public function __construct(int|MongoDB\BSON\Int64|DateTimeInterface|null $milliseconds = null)
final public function jsonSerialize(): mixed
final public function toDateTime(): DateTime
final public function toDateTimeImmutable(): DateTimeImmutable
final public function __toString(): string
}
Versión Descripción
PECL mongodb 2.0.0 Esta clase ya no implementa la interfaz Serializable.
PECL mongodb 1.12.0 Implementa Stringable para PHP 8.0+.
PECL mongodb 1.3.0 Implementa MongoDB\BSON\UTCDateTimeInterface.
PECL mongodb 1.2.0 Implementa Serializable y JsonSerializable.

Tabla de contenidos

To Top