Skip to content

Commit 073d0cb

Browse files
committed
feat: remove unreleased Time::toDatabase()
Use __toString() instead.
1 parent 1e30fca commit 073d0cb

File tree

5 files changed

+0
-42
lines changed

5 files changed

+0
-42
lines changed

system/I18n/Time.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,12 +1179,4 @@ public function __wakeup(): void
11791179
$this->timezone = new DateTimeZone($timezone);
11801180
parent::__construct($this->date, $this->timezone);
11811181
}
1182-
1183-
/**
1184-
* Returns the datetime string ('Y-m-d H:i:s') that is safe to databases regardless of locale.
1185-
*/
1186-
public function toDatabase(): string
1187-
{
1188-
return $this->format('Y-m-d H:i:s');
1189-
}
11901182
}

tests/system/I18n/TimeTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,17 +1158,4 @@ public function provideLocales(): Generator
11581158
['fa'],
11591159
];
11601160
}
1161-
1162-
public function testToDatabase()
1163-
{
1164-
$currentLocale = Locale::getDefault();
1165-
Locale::setDefault('fa');
1166-
1167-
$time = Time::parse('2017-01-12 00:00', 'America/Chicago');
1168-
1169-
$this->assertSame('2017-01-12 00:00:00', (string) $time);
1170-
$this->assertSame('2017-01-12 00:00:00', $time->toDatabase());
1171-
1172-
Locale::setDefault($currentLocale);
1173-
}
11741161
}

user_guide_src/source/changelogs/v4.3.0.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ Libraries
115115

116116
- Added methods ``replace()``, ``addLineAfter()`` and ``addLineBefore()`` to modify files in Publisher. See :ref:`Publisher <publisher-modifying-files>` for details.
117117
- Now **Encryption** can decrypt data encrypted with CI3's Encryption. See :ref:`encryption-compatible-with-ci3`.
118-
- Added :ref:`Time::toDatabase() <time-todatabase>` to get a datetime string that can be used with databases regardless of locale.
119118

120119
Helpers and Functions
121120
=====================

user_guide_src/source/libraries/time.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,6 @@ Displays just the localized version of time portion of the value:
173173

174174
.. literalinclude:: time/018.php
175175

176-
.. _time-todatabase:
177-
178-
toDatabase()
179-
============
180-
181-
.. versionadded:: 4.3.0
182-
183-
This method returns a string that can be used with databases regardless of locale.
184-
185-
.. literalinclude:: time/042.php
186-
187176
humanize()
188177
==========
189178

user_guide_src/source/libraries/time/042.php

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)