genau Posted April 2, 2009 Report Share Posted April 2, 2009 Ir funkcija kas ņem datus no DB kas glabājas datetime formātā un mēnesi pārveido latvuski, taču visu laiku izdod janvāri. cik saprotu kļūda ir date funkcijā, pie $asd, angliski menesi no DB ņem pareizi. $asd=$myrow['dtime']; $z=date("n",$asd); $myarray=array("Janvāris","Februāris","Marts","Aprīlis","Maijs","Jūnijs","Jūlijs","Augusts","Septembrs","Oktobris","Novembris","Decembris"); $i=0; while($i <count($myarray)){ if($z==$i+1){ $z=$myarray[$i]; echo $z; } $i++; } Quote Link to comment Share on other sites More sharing options...
marcis Posted April 2, 2009 Report Share Posted April 2, 2009 $months=array( 1=>"Javāris", 2=>"Februāris", 3=>"Marts", 4=>"Aprīlis", 5=>"Maijs", 6=>"Jūnijs", 7=>"Jūlijs", 8=>"Augusts", 9=>"Septembris", 10=>"Oktobris", 11=>"Novembris", 12=>"Decembris", ); echo $months[(int)date("n",strtotime($myrow['dtime']))]; Quote Link to comment Share on other sites More sharing options...
genau Posted April 2, 2009 Author Report Share Posted April 2, 2009 paldies par palīdzību! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.