Kapyrossi Posted November 6, 2007 Report Share Posted November 6, 2007 Sveiki, iespējams, ka elementārs jautājums, bet nevaru izdomāt un nevaru atrast padomu onlainā. Ir MySQL datubāze. Katram ierakstam ir timestamp. Ar php atlasot ierakstus no datubāzes vajag no timestamp dabūt ārā tikai datumu nevis pilno (yyyy-mm-dd hh-mm-ss). Būšu pateicīgs par padomu! Link to comment Share on other sites More sharing options...
andrisp Posted November 6, 2007 Report Share Posted November 6, 2007 date('Y-m-d', $unix_timestamp); php.net/date Link to comment Share on other sites More sharing options...
Vebers Posted November 6, 2007 Report Share Posted November 6, 2007 (edited) SELECT FROM_UNIXTIME(lauks_kur_galajas_timestamp) as datetime; Edited November 6, 2007 by MakaTaNaw Link to comment Share on other sites More sharing options...
Grey_Wolf Posted November 7, 2007 Report Share Posted November 7, 2007 andrisp & MakaTaNaw --> ta cilvecinjam vajag nevis no Unixtime , bet no SQL datuma dabut kadu dalju.... Kapyrossi --> izmanto DATE_FORMAT().... strada tapat kaa date() ieksh PHP .... piemera gan ir pilns datums, bet nu izvelies ko pasam vajag...... SELECT DATE_FORMAT(datums ,'%d.%m.%y %H:%i') AS formatets_datums FROM tabulis Link to comment Share on other sites More sharing options...
Recommended Posts