Closed dlbaran closed 3 years ago
the easiest syntax is:
jdate($databaseDate)->format('Y-m-d H:i:s');
the easiest syntax is:
jdate($databaseDate)->format('Y-m-d H:i:s');
Dear Kargar, Thank you for your help. Excuse me, I am a beginner in php. Can you give me some tips on how I can use this code? Best Regards,
not much to do. if you are using laravel , you can use this syntax anywhere(controller , model, view , etc..) :
return jdate('2020-12-07')->format('Y-m-d'); // output : 1399-09-17
and if you are using just php without framwork :
require "/vendor/autoload.php";
echo jdate('2020-12-07')->format('Y-m-d'); // output : 1399-09-17
and if you want more examples , just check the Morilog/jalali Readme
Hi, I need to display the date stored in the Gregorian database in Jalali. How can I do this using your library? My codes are as follows:
elseif($column_type_lookup[$column_name] == 'date'){ //date with format MM/DD/YYYY if(!empty($row[$column_name]) && ($row[$column_name] != '0000-00-00')){ $form_data[$i][$j] = date('M d, Y',strtotime($row[$column_name])); }