dAivEd Posted March 19, 2010 Report Share Posted March 19, 2010 Sveiks! Ka var ar PHP palidzibu parkonvertet shitadu datumu "Mar 22 2010 12:00:00:000AM" pret normalu? Paldies par atsaucibu. Quote Link to comment Share on other sites More sharing options...
waplet Posted March 19, 2010 Report Share Posted March 19, 2010 (edited) kas skaitaas normaals?? Edited March 19, 2010 by waplet Quote Link to comment Share on other sites More sharing options...
Valis Posted March 19, 2010 Report Share Posted March 19, 2010 (edited) Sveiks, Vari mēģināt šo stringu palaist caur strtotime un tad ar date('d m y', timestamp) Edited March 19, 2010 by Valis Quote Link to comment Share on other sites More sharing options...
dAivEd Posted March 19, 2010 Author Report Share Posted March 19, 2010 (edited) Sveiks, Vari mēģināt šo stringu palaist caur strtotime un tad ar date('d m y', timestamp) Pameginaaju shita: $date_end = date('d m y', strtotime($siege_end_date ) ); $siege_end_date - ir tieshi tas datums kuru es uzrakstiju augstak Raada "01 01 70", taatad nesanaaca diemzhel, vel idejas ir ? Edited March 19, 2010 by dAivEd Quote Link to comment Share on other sites More sharing options...
dAivEd Posted March 19, 2010 Author Report Share Posted March 19, 2010 (edited) kas skaitaas normaals?? emm... Def. datums dd.mm.yyyy, vaitad kads vel izmanto citus datumus ? :D Edited March 19, 2010 by dAivEd Quote Link to comment Share on other sites More sharing options...
2easy Posted March 19, 2010 Report Share Posted March 19, 2010 starptautiskais standarts ir: yyyy-mm-dd Quote Link to comment Share on other sites More sharing options...
2easy Posted March 19, 2010 Report Share Posted March 19, 2010 anyway no tā esošā datuma paņem visas vajadzīgās vērtības: gads, mēnesis, diena, stunda, ... un padod iekš mktime(). tālāk jau šo laiku noformatē ar date(), kā vien vajag Quote Link to comment Share on other sites More sharing options...
briedis Posted March 19, 2010 Report Share Posted March 19, 2010 vispār jau varēji saņemties un pagūglēt... vai tad tiešām TAS IR TIK GRŪTI? atslēgvārdu: "mssql date to unix" Quote Link to comment Share on other sites More sharing options...
Mr.Key Posted March 19, 2010 Report Share Posted March 19, 2010 (edited) es parasti izmantoju select unix_timestamp(mysql_datetime_kolonna) un tad ar php formatēju kā parasto timestampu protams, tas ir viens no entajiem variantiem, nianses sākas ar timezonām, bet tas diezvai te ir svarīgi Edited March 19, 2010 by Mr.Key Quote Link to comment Share on other sites More sharing options...
mounkuls Posted March 19, 2010 Report Share Posted March 19, 2010 Pameginaaju shita: $date_end = date('d m y', strtotime($siege_end_date ) ); $siege_end_date - ir tieshi tas datums kuru es uzrakstiju augstak Raada "01 01 70", taatad nesanaaca diemzhel, vel idejas ir ? Tātad $siege_end_date atgrieza nulli, 01 01 70 ir Unix ēras sākums, kad time()=0 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.