���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
repositories
/
dasterang-old
/
vendor
/
morilog
/
jalali
/
src
/
Viewing: Converter.php
<?php namespace Morilog\Jalali; use Carbon\Exceptions\UnitException; use Date; /** * Trait Converter. * * Change date into different string formats and types and * handle the string cast. */ trait Converter { /** * Format the instance as date * * @return string */ public function toDateString() { return $this->format("Y/m/d"); } /** * Format the instance as a readable date * * @return string */ public function toFormattedDateString() { return $this->format('j F Y'); } /** * Format the instance with the day, and a readable date * * @return string */ public function toFormattedDayDateString() { return $this->format('l j F Y'); } /** * Format the instance as time * * @param string $unitPrecision * * @return string */ public function toTimeString($unitPrecision = 'second') { return $this->format(static::getTimeFormatByPrecision($unitPrecision)); } /** * Format the instance as date and time * * @param string $unitPrecision * * @return string */ public function toDateTimeString($unitPrecision = 'second') { return $this->format('Y/m/d ' . static::getTimeFormatByPrecision($unitPrecision)); } /** * Format the instance as a readable date and time * * @param string $unitPrecision * * @return string */ public function toFormattedDateTimeString($unitPrecision = 'second') { return $this->format('j F Y ' . static::getTimeFormatByPrecision($unitPrecision)); } /** * Return a format from H:i to H:i:s.u according to given unit precision. * * @param string $unitPrecision "minute", "second", "millisecond" or "microsecond" * * @return string */ public static function getTimeFormatByPrecision($unitPrecision) { switch (Date::singularUnit($unitPrecision)) { case 'minute': return 'H:i'; case 'second': return 'H:i:s'; case 'm': case 'millisecond': return 'H:i:s.v'; case 'µ': case 'microsecond': return 'H:i:s.u'; } throw new UnitException('Precision unit expected among: minute, second, millisecond and microsecond.'); } /** * Format the instance as date and time T-separated with no timezone * echo Jalalian::now()->toDateTimeLocalString('minute'); // You can specify precision among: minute, second, millisecond and microsecond * ``` * * @param string $unitPrecision * * @return string */ public function toDateTimeLocalString($unitPrecision = 'second') { return $this->format('Y-m-d\T' . static::getTimeFormatByPrecision($unitPrecision)); } /** * Format the instance with day, date and time * * @param string $unitPrecision * * @return string */ public function toDayDateTimeString($unitPrecision = 'second') { return $this->format('l j F Y ' . static::getTimeFormatByPrecision($unitPrecision)); } /** * Format the instance with the year, and a readable month * * @return string */ public function toFormattedMonthYearString() { return $this->format('F Y'); } }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa