403Webshell
Server IP : 62.60.133.156  /  Your IP : 216.73.217.51
Web Server : LiteSpeed
System : Linux linux24.centraldnserver.com 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64
User : mimradmin ( 1166)
PHP Version : 7.4.33
Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : OFF |  Pkexec : OFF
Directory :  /proc/self/cwd/wp-content/plugins/persian-woocommerce/vendor/morilog/jalali/src/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /proc/self/cwd/wp-content/plugins/persian-woocommerce/vendor/morilog/jalali/src/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');
    }

}

Youez - 2016 - github.com/yon3zu