@@ -96,9 +96,9 @@ UUID objects created with the ``Uuid`` class can use the following methods
96
96
$uuid = Uuid::v4();
97
97
$uuid instanceof UuidV4; // true
98
98
99
- // getting the UUID time (it's only available in certain UUID types)
99
+ // getting the UUID datetime (it's only available in certain UUID types)
100
100
$uuid = Uuid::v1();
101
- $uuid->getTime (); // e.g. float(1584111384.2613)
101
+ $uuid->getDateTime (); // returns a \DateTimeImmutable instance
102
102
103
103
// comparing UUIDs and checking for equality
104
104
$uuid1 = Uuid::v1();
@@ -111,6 +111,11 @@ UUID objects created with the ``Uuid`` class can use the following methods
111
111
// * int < 0 if $uuid1 is less than $uuid4
112
112
$uuid1->compare($uuid4); // e.g. int(4)
113
113
114
+ .. versionadded :: 5.3
115
+
116
+ The ``getDateTime() `` method was introduced in Symfony 5.3. In previous
117
+ versions it was called ``getTime() ``.
118
+
114
119
Storing UUIDs in Databases
115
120
~~~~~~~~~~~~~~~~~~~~~~~~~~
116
121
@@ -250,14 +255,19 @@ ULID objects created with the ``Ulid`` class can use the following methods::
250
255
// checking if a given value is valid as ULID
251
256
$isValid = Ulid::isValid($ulidValue); // true or false
252
257
253
- // getting the ULID time
254
- $ulid1->getTime (); // e.g. float(1584111384.2613)
258
+ // getting the ULID datetime
259
+ $ulid1->getDateTime (); // returns a \DateTimeImmutable instance
255
260
256
261
// comparing ULIDs and checking for equality
257
262
$ulid1->equals($ulid2); // false
258
263
// this method returns $ulid1 <=> $ulid2
259
264
$ulid1->compare($ulid2); // e.g. int(-1)
260
265
266
+ .. versionadded :: 5.3
267
+
268
+ The ``getDateTime() `` method was introduced in Symfony 5.3. In previous
269
+ versions it was called ``getTime() ``.
270
+
261
271
Storing ULIDs in Databases
262
272
~~~~~~~~~~~~~~~~~~~~~~~~~~
263
273
0 commit comments