Convert Jalali calendar to Gregorian by PHP in CodeIgniter

rostamiani picture rostamiani · May 4, 2015 · Viewed 8.1k times · Source

I need to store Date in Persian (Jalali) date in MySQL. I'm using CodeIgniter. I need something like this:

$Date = Jalali_to_Georgian(1393,5,28) // Output: "2014/08/19"

Do I need to create a new library for this?

Answer

borisano picture borisano · May 6, 2015

It's generally better to stick to existing libs rather than writing your own one. Try, for example, jDateTime or Gregorian-Jalali-Date-Convertor.

P.S. I never tried to use them myself, but first one looks much more solid.