[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: DateTime.php
<?php namespace Safe; use DateInterval; use DateTimeInterface; use DateTimeZone; use Safe\Exceptions\DatetimeException; /** this class implements a safe version of the Datetime class */ class DateTime extends \DateTime { //switch from regular datetime to safe version private static function createFromRegular(\DateTime $datetime): self { return new self($datetime->format('Y-m-d H:i:s.u'), $datetime->getTimezone()); } /** * @param string $format * @param string $time * @param DateTimeZone|null $timezone * @throws DatetimeException */ public static function createFromFormat($format, $time, $timezone = null): self { $datetime = parent::createFromFormat($format, $time, $timezone); if ($datetime === false) { throw DatetimeException::createFromPhpError(); } return self::createFromRegular($datetime); } /** * @param DateTimeInterface $datetime2 The date to compare to. * @param boolean $absolute [optional] Whether to return absolute difference. * @return DateInterval The DateInterval object representing the difference between the two dates. * @throws DatetimeException */ public function diff($datetime2, $absolute = false): DateInterval { /** @var \DateInterval|false $result */ $result = parent::diff($datetime2, $absolute); if ($result === false) { throw DatetimeException::createFromPhpError(); } return $result; } /** * @param string $modify A date/time string. Valid formats are explained in <a href="https://secure.php.net/manual/en/datetime.formats.php">Date and Time Formats</a>. * @return DateTime Returns the DateTime object for method chaining. * @throws DatetimeException */ public function modify($modify): self { /** @var DateTime|false $result */ $result = parent::modify($modify); if ($result === false) { throw DatetimeException::createFromPhpError(); } return $result; } /** * @param int $year * @param int $month * @param int $day * @return DateTime * @throws DatetimeException */ public function setDate($year, $month, $day): self { /** @var DateTime|false $result */ $result = parent::setDate($year, $month, $day); if ($result === false) { throw DatetimeException::createFromPhpError(); } return $result; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.81 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002