News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Displaying the date without the time?

Started by Steve, October 12, 2014, 10:39:16 AM

Previous topic - Next topic

Steve

I ran across a tip that makes each topic show the date and time it started but I'd like it to do it without the time part.

How would I change this:

',$topic['first_post']['time'],'

to accomplish that?
DO NOT pm me for support!

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Steve

That's going to take a lot of studying for me as it's over my head and I'm not sure it's worth it.

Thanks for the reply. :)
DO NOT pm me for support!

margarett

#3
No, it should be fairly easy (I think :P )

Can you point me to that trick?

edit: this should work:
date('Y-m-d', $topic['first_post']['timestamp'])
You can play with that "Y-M-d" format, check what they mean with http://us.php.net/manual/en/function.date.php
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Burke ♞ Knight

Something like this, would show the date just like SMF does, without the time.
Like this: October 12, 2014

' ,date('F d, Y', $topic['first_post']['timestamp']), '

Steve

Quote from: margarett on October 12, 2014, 02:35:03 PMCan you point me to that trick?

I'll have to get the author's permission as it's not posted on this board. :)

Quote from: BurkeKnight on October 12, 2014, 03:51:08 PM' ,date('F d, Y', $topic['first_post']['timestamp']), '

Awesome! :D
DO NOT pm me for support!

Advertisement: