MongoDB\BSON\UTCDateTime::__construct

(mongodb >=1.0.0)

MongoDB\BSON\UTCDateTime::__constructConstruct a new UTCDateTime

Beschreibung

final public MongoDB\BSON\UTCDateTime::__construct(int|float|string|DateTimeInterface $milliseconds = null)

Parameter-Liste

milliseconds (int|float|string|DateTimeInterface)

Number of milliseconds since the Unix epoch (Jan 1, 1970). Negative values represent dates before 1970. This value may be provided as a 64-bit int. For compatibility on 32-bit systems, this parameter may also be provided as a float or string.

If the argument is a DateTimeInterface, the number of milliseconds since the Unix epoch will be derived from that value. Note that in versions of PHP versions before 7.1.0, DateTime and DateTimeImmutable objects constructed from the current time did not incorporate sub-second precision.

If this argument is null, the current time will be used by default.

Fehler/Exceptions

Changelog

Version Beschreibung
PECL mongodb 1.2.0

The milliseconds argument is optional and defaults to null (i.e. current time). The argument also accepts a DateTimeInterface, which may be used to derive the number of milliseconds since the Unix epoch. Previously, only int, float, and string types were accepted.

Beispiele

Beispiel #1 MongoDB\BSON\UTCDateTime::__construct() example

<?php

var_dump
(new MongoDB\BSON\UTCDateTime);

var_dump(new MongoDB\BSON\UTCDateTime(new DateTime));

var_dump(new MongoDB\BSON\UTCDateTime(1416445411987));

?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

object(MongoDB\BSON\UTCDateTime)#1 (1) {
  ["milliseconds"]=>
  string(13) "1484852905560"
}
object(MongoDB\BSON\UTCDateTime)#1 (1) {
  ["milliseconds"]=>
  string(13) "1484852905560"
}
object(MongoDB\BSON\UTCDateTime)#1 (1) {
  ["milliseconds"]=>
  string(13) "1416445411987"
}

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

sell info fullz SSN/SIN search DOB + Scans DL Driver License 2026

HOT Seller CVV Good 2026 - NON VBV Credit Card/Debit Card U.P.D.A.T.E CVV 2026 Sell CVV Good info And High Balance (Cvv CC Fullz Credit Cards Du ...

Geschrieben von sellergood11 am 09.06.2026 23:32:23
Forum: SEO - Suchmaschinen Tricks und Tipps
Buy CVV Fullz ssn mmn dob (transfer paypal cashapp) ALL COUNTRIES 2026

----------- Welcome to my Store ---------- ************************=>>>>> my store CC Shop | Buy Live CVV Fullz info | Good CVV Site 2026 – Full ...

Geschrieben von sellergood11 am 09.06.2026 23:31:34
Forum: Tutorials
available Fullz Info Leads Ca/UK/US_SSN_MMN_DOB_DL_Photo front Back Lookup

******my store CC Shop | Buy Live CVV Fullz info | Good CVV Site 2026 – Fullz Dumps + Pin $$$***=>>>>>Wellcome to my store. You can buy CVV f ...

Geschrieben von sellergood11 am 09.06.2026 23:30:17
Forum: Apps und PHP Script Gesuche
Clone ATM Cards Ready For CashOut Info Fullz DEAD UK SSN Sortcode MMN DOB DL

VERIFIED CARDER SELLING WU,BANK,PAYPAL,CASHAPP,SKRILL TRANSFER BANK LOGS,DUMPS+PIN,CLONED CARDS​ telegram:@king_dumps12 SELL CCV CANADA FULLZ ...

Geschrieben von sellergood11 am 09.06.2026 23:29:24
Forum: Entwicklungsumgebungen