IIM, how do I get that to echo the time that things were posted from a database?

So I think I figured out why the indivdual blog post won't output the correct date format. The function "get_post" in the posts.inc.php file doesn't set the date to that correct format like in the function before it. However I'm not quite sure how to go about altering the code to have it show that format in date. Any suggestions?

Nevermind! I solved it! I just added the Date_Format() and added the format that I wanted in the "get_post" function. Now it makes sense..the get_post's' function had the right format as well as the comments function..it only makes sense that the "get_post" function have the same..fail on my part lol sorry for waisting time for you guys..

Member Avatar for LastMitch

Nevermind! I solved it! I just added the Date_Format() and added the format that I wanted in the "get_post" function. Now it makes sense..the get_post's' function had the right format as well as the comments function..it only makes sense that the "get_post" function have the same..fail on my part lol sorry for waisting time for you guys..

@geneh23

I'm glad you figure this out and find an solution!

The code you provided looks right and it's bit puzzle that it echo out 2 date format from your database server.

I can't duplicate 2 date format on my database server like what you have. It's usually 1 date format.

@LastMitch, What happened was, in my database, I set the date as datetime and that was the default setting when refering to the date that was displayed. With the other functions in the posts.inc.php and the comments.inc.php I had altered the format but I didn't change the blog_post function which would obvously affect the single posts, which is where I was having so much trouble. Since I didn't update that function with the correct date format, it fell back on the default setting from the database which was the datetime function in mysql. Make sense?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.