Giter Site home page Giter Site logo

basemax / phpjalalidate Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 33 KB

A tiny code to convert date into Jalali calendar using pure PHP code without extra library and code.

License: GNU General Public License v3.0

PHP 100.00%
php jalali-datetime jalali-date date-converter

phpjalalidate's Introduction

PHP Jalali Date

A tiny code to convert date into Jalali calendar using Pure PHP code without extra library and code.

Using

array jalaliDate(?int $year, ?int $month, ?int $day)

Default Timezone

date_default_timezone_set('Asia/Tehran');
// OR
date_default_timezone_set('America/New_York');

Examples

First you need to include the library by include "src/JalaliDate.php"; next:

print_r(jalaliDate()); // It will return today date in Jalali date system.
// Array
// (
//     [year] => 1401
//     [month] => 08
//     [day] => 04
// )

print_r(jalaliDate(2022, 9, 26));
// Array
// (
//     [year] => 1401
//     [month] => 07
//     [day] => 04
// )

Related Repository

You can see the solution algorithm for most programming languages at here.

https://github.com/BaseMax/gregorian_to_jalali


Max Base

My nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers. (Max Base)

Asrez Team

A team includes some programmer, developer, designer, researcher(s) especially Max Base.

Asrez Team

phpjalalidate's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.