eT` Posted February 22, 2010 Report Share Posted February 22, 2010 Tātad pašlaik man date tiek izsaukts šādi: $seen = date("d", $row["lastvisit"]); $datums = date("d"); if($datums - $seen == 1) { $redzets = '<b>vakar '.date("H:i", $row["lastvisit"]).'</b>'; } elseif($datums - $seen == 0) { $redzets = '<b>šodien '.date("H:i", $row["lastvisit"]).'</b>'; } else { $redzets = '<b>'.date("j. F H:i", $row["lastvisit"]).'</b>'; } bet kā izdarīt lai January vietā būtu rakstīts janvārī? man jātaisa masīvs ar katra mēneša latvisko un anglisko vērtību un jāaizvieto vai date f-jā ir iekļauti risinājumi citām valstīm? Quote Link to comment Share on other sites More sharing options...
vitao.web Posted February 22, 2010 Report Share Posted February 22, 2010 Sveiks! Neesmu nekāds profesionālis , bet liekas ka tomēr būs jāveido pašam savs masīvs. Bet nu negribu sameloties, kā jau teicu neesmu profesionālis! Quote Link to comment Share on other sites More sharing options...
eT` Posted February 22, 2010 Author Report Share Posted February 22, 2010 (edited) kaut kā nebūt izdomāju :) $seen = date("d", $row["lastvisit"]); $datums = date("d"); if($datums - $seen == 1) { $redzets = '<b>vakar '.date("H:i", $row["lastvisit"]).'</b>'; } elseif($datums - $seen == 0) { $redzets = '<b>šodien '.date("H:i", $row["lastvisit"]).'</b>'; } else { $masivs = array( "janvārī" => "January", "februārī" => "February", "martā" => "March", "aprīlī" => "April", "maijā" => "May", "jūnijā" => "June", "jūlijā" => "July", "augustā" => "August", "septembrī" => "September", "oktobrī" => "October", "novembrī" => "November", "decembrī" => "December" ); $tagad = date("F", $row["lastvisit"]); $menesis = array_search($tagad, $masivs); $redzets = '<b>'.date("j.", $row["lastvisit"]).' '.$menesis.' '.date("H:i", $row["lastvisit"]).'</b>'; } Edited February 22, 2010 by eT` Quote Link to comment Share on other sites More sharing options...
mickys Posted February 22, 2010 Report Share Posted February 22, 2010 (edited) setlocale(LC_ALL,'lv_LV'); iespējams LV vietā - LAV P.S. Mēdz ne visur darboties Edited February 22, 2010 by mickys Quote Link to comment Share on other sites More sharing options...
2easy Posted February 22, 2010 Report Share Posted February 22, 2010 P.S. Mēdz ne visur darboties yep, universālāk ir, kad pats sadefinē konstantes vai liek arrayā Quote Link to comment Share on other sites More sharing options...
Kemito Posted February 22, 2010 Report Share Posted February 22, 2010 Ieteicams ripināt arī klāt tādu PHP funkciju kā time() ! Lai paņemtu servera laiku, ja reiz ņem! Quote Link to comment Share on other sites More sharing options...
2easy Posted February 22, 2010 Report Share Posted February 22, 2010 Ieteicams ripināt arī klāt tādu PHP funkciju kā time() ! Lai paņemtu servera laiku, ja reiz ņem! viņš taču ņem laiku no tabulas! 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.