PHP code example of pouyasoft_ir / simple-date-bundle
1. Go to this page and download the library: Download pouyasoft_ir/simple-date-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pouyasoft_ir / simple-date-bundle example snippets
$shamsiString = $this->get('pouya_soft.j_sdate_service')->georgianToPersian(new \DateTime(), 'yyyy-MM-dd E');
//result: ۱۳۹۴-۱۱-۲۲ دوشنبه
$shamsiString = $this->get('pouya_soft.j_sdate_service')->persianToGeorgian('1394-11-22 دوشنبه', 'yyyy-MM-dd E');
//result: An instance of DateTime