renathy Posted March 30, 2009 Report Share Posted March 30, 2009 Man ir string formātā date (dd.mm.yyyy) un time (mm.hh). Kā šos divus var ērti sakombinēt vienā, lai iegūtu pareizu unixtimestamp, kas atbilstu attiecīgai dienai un laikam? Kā arī - kā pēc tam var atkombinēt atpakaļ? Quote Link to comment Share on other sites More sharing options...
KillerBean Posted March 30, 2009 Report Share Posted March 30, 2009 domā mktime() ? Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted March 30, 2009 Report Share Posted March 30, 2009 viis atkariigs ko velies dariit, ja saglabat ieksh DB tad labak parveidot par SQL formata DATETIME , vai DATE un TIME formatu, ja vajag ko skaitljot tad skaties Uz time funkcijam , strtotime(), mktime().. Quote Link to comment Share on other sites More sharing options...
renathy Posted March 30, 2009 Author Report Share Posted March 30, 2009 Man vajaga lai saglabštu mysql, bet es tur glabāju kā parastu int. Laikam tad mktime derēs. Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted March 30, 2009 Report Share Posted March 30, 2009 vienmer esmu teicis ka DB datumus labak glabat Tam paredzetajaa formata... Tas dod daudz plasaku iespeju manupulet ar datiem , meklet , kartot, atlasiit utt... Piemeram kaa tu saglabasi dzimsanas datus t UNIX timestap formataa , cilvekam kas dzimis 1969.g 12 .12 ???? Ljoti liels procents ka dabuusi galiigi aplamu rezultatu ( ne noteikti bet nu ljoti iespejams) Tapec jai ir izdomats Specefisks formats ...... 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.