Hi, i dont know if im always going to use mysql, thow your solution to my problem will be something like this:
SELECT DATE_FORMAT( endret_dato, \"%d%m%Y\" ) as endret_dato , headline , news from rnr_news order by endret_dato desc limit " . $index . "," . ($index+10)); Thanx for your help! -R "John Holmes" <[EMAIL PROTECTED]> wrote in message 000001c232b4$11419d10$b402a8c0@mango">news:000001c232b4$11419d10$b402a8c0@mango... > > Thanx for the help.. > > > > I ended up with this solution ;) > > > > $dag = substr ( $row['endret_dato'], 7, 2 ); > > $mnd = substr ( $row['endret_dato'], 4, 2 ); > > $aar = substr ( $row['endret_dato'], 0, 4 ); > > > > date ("dmY", mktime(0,0,0,$mnd,$dag,$aar) ) > > Did you even read the replies? Why are you going to do a bunch of string > manipulation, mktime, and date calls in PHP when you can just use > DATE_FORMAT() in your query and get exactly what you want without any > additional work by PHP? > > Take a little time and Read Chapter 6 of the MySQL manual. It will save > you a ton of work later on... > > ---John Holmes... > > > > -R > > > > "Ragnar" <[EMAIL PROTECTED]> wrote in message > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > I have a column in a mysql table with a timestamp. The value of this > > column > > > is for instance: > > > > > > 20020722185242 > > > > > > How do i change the format on this to "DDMMYYYY" (22072002) in php? > > > > > > Thanx > > > > > > -R > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php