show_date ; /////////////////////////////////////////////////////////////// //define class for Convert English date to Thai date. class TDConv { /* ** properties */ var $d; //day ex. 1-31 var $dd; //day in week ex. monday - sunday var $mmm; //month in year ex. January or Jan var $yyy; //present year ex. 2001 or 2544 var $show_date; // Complete Date ex. 23 jun 1963 /* ** methods */ function TDConv($dateType) { $chkd =date(\"j\"); $this->d = date(\"j\") ; //show 1 - 31 $this->yyy = date(\"Y\")+543 ; switch ($dateType) { case (\"dd-mm-yy\") : switch (date(\"l\")) { case \"Monday\" : $this->dd= \"ѹ\"; break; case \"Tuesday\" : $this->dd= \"ѧ\"; break; case \"Wednesday\" : $this->dd= \"ظ\"; break; case \"Thursday\" : $this->dd= \"ʺ\"; break; case \"Friday\" : $this->dd= \"ء\"; break; case \"Saturday\" : $this->dd= \"\"; break; default: $this->dd= \"ҷԵ\"; break; } switch(date(\"F\")) { case \"January\" : $this->mmm = \"Ҥ\"; break; case \"February\" : $this->mmm = \"Ҿѹ\" ; break; case \"March\" : $this->mmm = \"չҤ\" ; break; case \"April\" : $this->mmm = \"¹\" ; break; case \"May\" : $this->mmm = \"Ҥ\" ; break; case \"June\" : $this->mmm = \"Զع¹\" ; break; case \"July\" : $this->mmm = \"áҤ\"; break; case \"August\" : $this->mmm = \"ԧҤ\" ; break; case \"September\" : $this->mmm = \"ѹ¹\" ; break; case \"October\" : $this->mmm = \"Ҥ\" ; break; case \"November\" : $this->mmm = \"Ȩԡ¹\" ; break; default : $this->mmm= \"ѹҤ\"; break; } $this->show_date= $this->dd.\" \".$this->d.\" \".$this->mmm.\" .. \".$this->yyy ; break ; case (\"d-m-y\") : switch(Date(\"F\")) { case \"January\" : $this->mmm= \"..\"; break; case \"February\" : $this->mmm= \"..\" ; break; case \"March\" : $this->mmm= \"..\" ; break; case \"April\" : $this->mmm= \"..\" ; break; case \"May\" : $this->mmm= \"..\" ; break; case \"Junuary\" : $this->mmm= \"..\" ; break; case \"July\" : $this->mmm= \"..\"; break; case \"August\" : $this->mmm= \"..\" ; break; case \"September\" : $this->mmm= \"..\" ; break; case \"October\" : $this->mmm= \"..\" ; break; case \"November\" : $this->mmm= \"..\" ; break; default : $this->mmm= \"..\"; } $this->show_date= $this->d.\" \".$this->mmm.\" \".$this->yyy ; break ; default : $this->show_date= $this->d.\" \".$this->mmm.\" \".$this->yyy ;; break; } } } ?>