Jump to content

help with reformatting the date ...


imarockstar

Recommended Posts

I need the MYSQL date format reformatted .. which the below does fine. But I was wandering if there was a function to automatically get the day of the week to be outputted as well ?

 

<?
	$date  = $rows['sh_date'];
        $newdate = explode("-", $date);
        $showdate = "".$newdate[1].".".$newdate[2].".".$newdate[0]."";
        echo $showdate;

	?>

 

Link to comment
Share on other sites

I did see that, however my problem is that i have over 500 records in my DB with the date stored like this : 2010-01-10.

 

I didn't want to have to go add the day of the week to each of those records. Was not sure if there was a function that would somehow get the dat of the week based on 2010-01-10.

 

 

Link to comment
Share on other sites

The date_format() function has absolutely nothing to do with adding anything to your columns. It returns information about date values (in columns or otherwise) and some of the choices listed include getting the day of the week, either as a three letter abbreviation, the whole day name, or as a number, depending on which formatting parameter you choose.

Link to comment
Share on other sites

ok either I am totally stupid or I explained my problem incorrectly .. um r both lol ..

 

I am displaying my date this way via php :

 

echo $rows['sh_date'];

 

which is displayed as this :  2010-01-10

 

In php is there a function that takes 2010-01-10 and figures out what day of the week that is and then can return the new value to be displayed as :  Wednesday January 10 2010

 

That link you sent me is confusing the hell out of me ..

 

sorry for the stupidity ..

 

b

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.