Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
V

verta

> 后端框架
Open source

تبدیل تاریخ میلادی به شمسی برای لاراول و کار با تاریخ جلالی و اعتبارسنجی تاریخ

659 stars0 likes1 views
WebsiteGitHub

About

تبدیل تاریخ میلادی به شمسی برای لاراول و کار با تاریخ جلالی و اعتبارسنجی تاریخ

hekmatinasser/verta

English Document

The Verta is package for change solar calendar and gregorian together and provide helper function to use date and time.

Verta extend class PHP Datetime and Jalali, compatible with Carbon Package.

This package has been created by Nasser Hekmati under the license of MIT.

Quick view

  • Installation
  • Usage
    • Jalali to Gregorian
    • Gregorian to Jalali
    • Jalali to Carbon
    • Carbon to Jalali
  • Getters
  • Setters
    • Fluent Setters
  • Formatting
    • Common Formats
    • Difference for Humans
  • Modification
  • Boundaries
  • Compression
    • Difference
  • Validation
  • Localization
  • Validation Request
  • Licence
  • Contributors

Installation

bash
composer require hekmatinasser/verta
    Laravel Version
    Package Version






    8.0
    8.0




    9.0
    8.2




    10.0
    8.3




    11.0
    8.4




    12.0
    8.5

Usage

use verta datetime jalali

php
echo verta(); //1401-05-24 00:00:00

Gregorian to Jalali

change gregorian to jalali and reverse

php
echo verta('2022-08-15'); //1401-05-24 00:00:00

jalali to Gregorian

change jalali to gregorian and reverse

php
echo Verta::parse('1401-05-24 14:12:32')->datetime(); //2022-08-15 00:00:00

Carbon to Jalali

change carbon to jalali and reverse

php
echo now()->toJalali(); //1401-05-24 00:00:00

Jalali to Carbon

change jalali to gregorian and reverse

php
echo verta()->toCarbon(); //2022-08-15 00:00:00

view more function

Getters

access part of jalali datetime

php
$v = verta(); // 1396-03-14 14:18:23
echo $v->year; // 1396

view more getter

Setters

set part of jalali datetime

php
$v = verta(); // 1396-03-14 14:18:23
echo $v->year = 1395;

view more setter

Fluent Setters

set multiple part of jalali datetime

php
$v = verta(); // 1396-03-14 14:18:23
echo $v->setTimeString('12:25:45');

view more fluent setter

Formatting

show datetime variant datetime

php
echo verta()->format('Y.m.d'); // 1401.05.24
echo verta()->formatWord('l dS F'); // دوشنبه بیست و چهارم مرداد

view more format

Common Formats

show common datetime variant datetime

php
echo verta()->formatJalaliDatetime(); // output 1395/10/07 14:12:25

view more common format

Difference for Humans

show difference format readable humans

php
echo verta('-13 month')->formatDifference(); // 1 سال قبل

view more format difference

Modification

manipulate jalali datetime

php
echo verta()->addWeeks(3); 
...

view more modifications

Boundaries

get boundary jalali datetime

php
echo verta()->startWeek(3); 

view more boundaries

Compression

get compression jalali datetime

php
echo verta('+2 day')->gte('2022-08-15');

view more compression

Difference

calculate difference two jalali datetime

php
echo verta('+13 day')->diffMonths('2022-08-15'); 

view more differences

Validation

check datetime check is valid

php
echo Verta::isLeapYear(1394); // false

view more validations

Localization

set language for formatting datetime

php
Verta::setLocale('ar');

view more localizations

Validation Request

validation input form

php
'birthday' => ['required', 'jdate_before_equal']

view more localizations

Licence

This package has been created by Nasser Hekmati under the license of MIT.

Contributors

Thanks to people who contributed for grow verta.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPcarbonconvert-numbersdatetimegaregorian

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架