Convert date dd/mm/yyyy to ddd ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Nasimov
Forum Newbie
Posts: 2
Joined: Thu Feb 19, 2004 11:51 am
Location: EarthPlanet

Convert date dd/mm/yyyy to ddd ?

Post by Nasimov »

I have the date taken form a mySQL db set in format: DD/MM/YYYY - (i.e. 17/02/2004), how can I display the day for that particular date (i.e Tuesday).

Thanks.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

It's possible no doubt, but it won't be easy :S
User avatar
johnperkins21
Forum Contributor
Posts: 140
Joined: Mon Oct 27, 2003 4:57 pm

Post by johnperkins21 »

User avatar
Dr Evil
Forum Contributor
Posts: 184
Joined: Wed Jan 14, 2004 9:56 am
Location: Switzerland

Post by Dr Evil »

You can try this:

Code: Select all

<?php
$date = "17/02/2004";
$parts= explode("/",$date);
echo date("l",mktime(0, 0, 0, $parts[1], $parts[0], $parts[2]));
?>
But why do you not get the date from your SELECT query ?
Post Reply