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? 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. First, Create a library in application/libraries named Calendar.php Class Calendar { function jalali_to_gregorian($j_y, $j_m, $j_d) { $g_days_in_month = array(31,