Esempio n. 1
0
 function testToTimestamp()
 {
     $this->assertEquals(Jalali::ToTimestamp(1391, 11, 15), strtotime(date("Y-m-d", $this->Timestamp)));
     $this->assertEquals(Jalali::ToTimestamp(1391, 11, 15, 1), strtotime(date("Y-m-d", $this->Timestamp)) + 23 * 3600);
     $this->assertEquals(Jalali::ToTimestamp(1391, 11, 15, 1, 39), strtotime(date("Y-m-d", $this->Timestamp)) + 23 * 3600 + 9 * 60);
     $this->assertEquals(Jalali::ToTimestamp(1391, 11, 15, 1, 39, 26), $this->Timestamp);
     $this->assertEquals(Jalali::ToTimestamp("1391-11-15 1:39:26"), $this->Timestamp);
 }
Esempio n. 2
0
 /**
  * Jalali::monthDayString()
  * 
  * returns long text day of the month
  * 
  * @param int $monthDayValue
  * @access protected
  * @return string
  */
 protected static function monthDayString($monthDayValue)
 {
     //echo "monthDayString($monthDayValue)<br/>";
     if (!Jalali::filterErrors($monthDayValue, 'd', self::$month)) {
         return;
     }
     $monthDays = array(1 => 'یکم', 'دوم', 'سوم', 'چهارم', 'پنجم', 'ششم', 'هفتم', 'هشتم', 'نهم', 'دهم', 'یازدهم', 'دوازهم', 'سیزدهم', 'چهاردهم', 'پانزدهم', 'شانزدهم', 'هفدهم', 'هژدهم', 'نوزدهم', 'بیستم', 'بیست و یکم', 'بیست و دوم', 'بیست و سوم', 'بیست و چهارم', 'بیست و پنجم', 'بیست و ششم', 'بیست و هفتم', 'بیست و هشتم', 'بیست و نهم', 'سی ام', 'سی و یکم');
     return $monthDays[$monthDayValue];
 }