Date Manager PHP Class

Overview

Date Manager

PHP Class Date Manager

Version 1.0.0

PHP class for date management, for example converting solar date to gregorian date and vice versa.

Contents

Methods

Name Arguments Options Description
gregorianToSolar Date Sign, Format Convert Gregorian Date To Solar Date
solarToGregorian Date Sign, Format Convert Solar Date To Gregorian Date
solarDate - Format Return Solar Date

Options

Name Description
Sign The Mark between year, month and date
For example, you can use the '-' or '/' sign. default is '-'
Format Format the return date
ymd: return year-month-day
dmy: return day-month-year
mdy: return month-day-year
ym: return year-month
md: return month-day
y: return year
m: return month
d: return day

Usage

require 'DateManager.php';
$date = new DateManager();

Example

Without options

Convert gregorian date to solar date

//without options
echo $date->gregorianToSolar('2021-07-22');
1400-04-31

Convert solar date to gregorian date

//without options
echo $date->solarToGregorian('1400-04-31');
2021-07-22

Get solar date

//without options
echo $date->solarDate();
1400-04-31

With options

Sign '-' and Year-month-day format

//Return with '-' sign and Year-Month-Day format
echo $date->gregorianToSolar('2021-07-22',['sign'=>'-','format'=>'ymd']);
1400-04-31

Sign '/' and Day-Month-Year format

//Return with '/' sign and Day-Month-Year format
echo $date->gregorianToSolar('2021-07-22',['sign'=>'/','format'=>'dmy']);
31/04/1400

Sign '/' and Month-Day-Year format

//Return with '/' sign and Month-Day-Year format
echo $date->gregorianToSolar('2021-07-22',['sign'=>'/','format'=>'mdy']);
04/31/1400

Sign '/' and Year-Month format

//Return with '/' sign and Year-Month format
echo $date->gregorianToSolar('2021-07-22',['sign'=>'/','format'=>'ym']);
1400/04

Sign '/' and Month-Day format

//Return with '/' sign and Month-Day format
echo $date->gregorianToSolar('2021-07-22',['sign'=>'/','format'=>'md']);
04/31

Sign '/' and Year format

//Return with '/' sign and Year format
echo $date->gregorianToSolar('2021-07-22',['sign'=>'/','format'=>'y']);
1400
You might also like...
Date/Time Picker widget for Yii2 framework Based on Eonasdan's Bootstrap 3 Date/Time Picker
Date/Time Picker widget for Yii2 framework Based on Eonasdan's Bootstrap 3 Date/Time Picker

Yii2 Date/Time Picker Widget Date/Time Picker widget for Yii2 framework Based on Eonasdan's Bootstrap 3 Date/Time Picker Demo Since this is a part of

PHP Router class - A simple Rails inspired PHP router class.

PHP Router class A simple Rails inspired PHP router class. Usage of different HTTP Methods REST / Resourceful routing Reversed routing using named rou

An amazing Rank and Permissions Manager. The best ranks manager for PocketMine-MP.

👑 RankSystem 🔧 An amazing Rank and Permissions Manager Description: An amazing Rank and Permissions Manager. The best ranks manager for PocketMine-M

TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application
TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application

TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application for storing, uploading, editing and managing files and folders online via web browser. The Application runs on PHP 5.5+, It allows the creation of multiple users and each user can have its own directory and a build-in support for managing text files with cloud9 IDE and it supports syntax highlighting for over 150+ languages and over 35+ themes.

flare Manager .flare framework Manager
flare Manager .flare framework Manager

flare-Manager flare Manager .flare framework Manager Welcome to the flare-Manager install Flare form https://github.com/flare-framework/Flare move ind

Laravel Podcast Manager is a complete podcast manager package for Laravel 5.3+ that enables you to manage RSS feeds for your favorite podcasts and listen to the episodes in a seamless UI.
Laravel Podcast Manager is a complete podcast manager package for Laravel 5.3+ that enables you to manage RSS feeds for your favorite podcasts and listen to the episodes in a seamless UI.

laravelpodcast | A Laravel podcast manager package - v0.0.8 Introduction Laravel Podcast Manager is a complete podcast manager package for Laravel 5.3

CI4-Lic is a software license manager modul for Codeigniter 4, connecting to WordPress license server based on the Software License Manager Plugin.

CI4-Lic CI4-Lic is a software license manager modul for Codeigniter 4, connecting to WordPress license server based on Software License Manager Plugin

Laragon MultiPHP per App + PECL Module + Extension manager + Ini Manager
Laragon MultiPHP per App + PECL Module + Extension manager + Ini Manager

LMPA Laragon MultiPHP per App This tools allow you to run multiple PHP version per app with Laragon, so you can have multiple site running different p

Laravel Manager - provides some manager functionality for Laravel
Laravel Manager - provides some manager functionality for Laravel

Laravel Manager Laravel Manager was created by, and is maintained by Graham Campbell, and provides some manager functionality for Laravel. Feel free t

Laravel Manager provides some manager functionality for Laravel
Laravel Manager provides some manager functionality for Laravel

Laravel Manager Laravel Manager was created by, and is maintained by Graham Campbell, and provides some manager functionality for Laravel. Feel free t

A custom WordPress nav walker class to fully implement the Twitter Bootstrap 4.0+ navigation style (v3-branch available for Bootstrap 3) in a custom theme using the WordPress built in menu manager.

WP Bootstrap Navwalker This code in the main repo branch is undergoing a big shakeup to bring it in line with recent standards and to merge and test t

COP4331 Class Project 1 - "ConnectUs" virtual contact manager/Rolodex

ConnectUs COP4331 Class Project 1 - "ConnectUs" virtual contact manager/Rolodex Team Members Orion (Project Manager) Eric (Database) Rafael (API/Backe

CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due

PHP Cron Expression Parser NOTE This fork has been deprecated and development moved to https://github.com/dragonmantank/cron-expression. More informat

:date: The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects

sabre/vobject The VObject library allows you to easily parse and manipulate iCalendar and vCard objects using PHP. The goal of the VObject library is

A PHP library for mocking date and time in tests

ClockMock Slope s.r.l. ClockMock provides a way for mocking the current timestamp used by PHP for \DateTime(Immutable) objects and date/time related f

CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due

The PHP cron expression parser can parse a CRON expression, determine if it is due to run, calculate the next run date of the expression, and calculate the previous run date of the expression. You can calculate dates far into the future or past by skipping n number of matching dates.

This is an experiment to export all RFCs from the PHP wiki into Git, including the change history for each RFC (along with the date and author of each change). This is not meant to replace the wiki.

PHP Requests for Comments (RFCs) About This repository is an experiment to export all RFCs from the PHP wiki into Git, including the change history fo

A Formatter Class for Laravel 4 based on FuelPHP's Formatter Class

Changelog Update support for Laravel 6 & phpunit 8 Update composer.json Upgrade to PSR-4 add parameter newline, delimiter, enclosure, and escape to ex

Exploiting and fixing security vulnerabilities of an old version of E-Class. Project implemented as part of the class YS13 Cyber-Security.

Open eClass 2.3 Development of XSS, CSRF, SQLi, RFI attacks/defences of an older,vulnerable version of eclass. Project implemented as part of the clas

Owner
Alireza Tolouei
PHP / Laravel Developer
Alireza Tolouei
Doctrine type mappings for brick/date-time

brick/date-time-doctrine Doctrine type mappings for brick/date-time. Introduction This library provides type mappings to use brick/date-time objects s

Brick 6 Jun 20, 2022
Add jalali(persian) date to akaunting software

Akaunting Jalali Date Akaunting Jalali Date is a free module developed for Akaunting. It automatically converts all dates to jalali date and change gr

Ali Hashemi 4 Dec 29, 2022
A fluent extension to PHPs DateTime class.

Expressive Date A fluent extension to PHPs DateTime class. Table of Contents Installation Composer Manually Laravel 4 Usage Getting Instances Quick He

Jason Lewis 258 Oct 9, 2021
A simple PHP API extension for DateTime.

Carbon An international PHP extension for DateTime. http://carbon.nesbot.com <?php use Carbon\Carbon; printf("Right now is %s", Carbon::now()->toDat

Brian Nesbitt 16k Dec 30, 2022
Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js

Support I am a dad now for the last 1,5 years and that clearly shows in being on time with merging PRs or pushing this package further. Time is the bi

Tino Ehrich 944 Dec 21, 2022
The easy PHP Library for calculating holidays

Introduction Yasumi (Japanese for 'Holiday'「休み」) is the easy PHP library that helps you retrieve the dates and names of holidays and other special cel

AzuyaLabs 926 Dec 29, 2022
The missing PHP 5.3+ calendar management library.

CalendR CalendR is an Object Oriented Calendar management library on top of PHP5.3+ Date objects. You can use it to deal with all your needs about cal

Yohan Giarelli 462 Dec 30, 2022
Parse and validate crontab expressions in PHP

Standard (V7) compliant crontab expression parser/validator with support for time zones; see "man 5 crontab" for possible expressions.

René Pollesch 42 Dec 14, 2022
iCal-creator for PHP - This package offers an abstraction layer for creating iCalendars files

This package offers an abstraction layer for creating iCalendars files. By using this PHP package, you can create *.ics files without the knowledge of the underling format. The output itself will follow RFC 5545 as good as possible.

Markus Poerschke 1k Dec 23, 2022
This library helps PHP users to convert and using Jalali DateTime format

Easy Jalali for PHP V1.0.0 Jalali calendar converter for Persian users in Iran, Afghanistan and other countries that use Jalali calendar. Very thanks

Majid J 3 Mar 20, 2022