homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

Why is converting date formats so difficult with php and mysql?

 1:20 pm on Jun 26, 2011 (gmt 0)

Someone please tell me how to make this work?

$result = mysql_query("SELECT * FROM kabf_blog ORDER BY id DESC LIMIT 10 DATE_FORMAT(datetime,%e.%c.%y)");

The field is titled 'datetime' and what's going into the field is:

$datetime = date ("Y-m-d H:m:s");

I just want to format the date so that June 26, 2011 reads like: 6.26.11

Is that so much to ask?

Why are dates so difficult to manipulate in PHP and SQL?

Anyone with the expertise to help get me though this, I truly appreciate you..!



 1:21 pm on Jun 26, 2011 (gmt 0)

I'm sure this is simple stuff for some of you - and I bet the topic has been covered to death - I just can't make sense of it no matter how much searching and reading I do...


 4:22 pm on Jun 26, 2011 (gmt 0)

Why would you want to introduce ambiguity into what you print?

Why would you want to add the "centuries problem" into what you print?

A European citizen, working for a US company in Japan tells you the order must be completed by "12.10.11". Do you have 3.5 months, 5.5 months or 15.5 months to complete this task?

2011-06-26 as YYYY-MM-DD is the ONLY date format that is understood in every country of the world.

They baked that into ANSI X3.30 in the late 1960s, ISO 8601 and EN 28601 in the mid-1980s and RFC 3339 in the early 2000s.


 5:26 pm on Jun 26, 2011 (gmt 0)

Alright, well it's for a local website and it's for aesthetic reasons... do you have any information that would be helpful for me?


 5:26 pm on Jun 26, 2011 (gmt 0)

I was just reading about ISO date standards yesterday so I am familiar with your point.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved