Benvenuto Posted July 10, 2008 Report Posted July 10, 2008 Problēma sekojoša: pie bloga ierakstiem datubāzē man ir TIMESTAMP šādā formātā: 2008-07-09 14:03:16 Bet RSS barotnei nepieciešams, cik saprotu, datums šādā formātā: Wed, 02 Jul 2008 12:43:43 Kā lai php skriptā kas ģenerē RSS lai pārvērš šo datumu vajadzīgajā paskatā?
andrisp Posted July 10, 2008 Report Posted July 10, 2008 date(formaats, strtotime('2008-07-09 14:03:16')); Formaati: http://lv2.php.net/manual/en/datetime.constants.php Vai arii pats noformee: http://lv2.php.net/manual/en/function.date.php
Grey_Wolf Posted July 10, 2008 Report Posted July 10, 2008 (edited) andrisp --> prieks kam tur vel PHP kodu? Mysql pats Ljoti perfekti mak izveidot nepieciesamo datuma formatu ... DATE_FORMAT() edit: Benvenuto --> tava variantaa skjiet kaa buutu sadi Wed, 02 Jul 2008 12:43:43 SELECT DATE_FORMAT( datums, "%a, %d %b %Y %T") AS formatets datums FROM tabulis Edited July 10, 2008 by Grey_Wolf
andrisp Posted July 10, 2008 Report Posted July 10, 2008 andrisp --> prieks kam tur vel PHP kodu? A kāpēc ne ?
Grey_Wolf Posted July 10, 2008 Report Posted July 10, 2008 A kāpēc ne ? Gluzji vienkarshi 1. lenak (nu protams sekunedes tukstosdaljas, bet tomer) 2. lieks kods...
Benvenuto Posted July 10, 2008 Author Report Posted July 10, 2008 (edited) Jess! Šis strādā. Paldies! Galabeigās pareizu pubDate izdevās uzģenerēt ar: date("D, d M o H:i:s O", strtotime($timestamp)) date(formaats, strtotime('2008-07-09 14:03:16')); Formaati: http://lv2.php.net/manual/en/datetime.constants.php Vai arii pats noformee: http://lv2.php.net/manual/en/function.date.php Edited July 10, 2008 by Benvenuto
Recommended Posts