Only gather year-month-day with {join_date}

larsheldens

New Member
Hello, I want to gather the date, and not de datetime.

I searched on the web and found this, but it doesn't work:
<?php echo date('d-M-Y', strtotime($join_date)); ?>

I will be very happy if someone could help me with this!
 
that should work just fine, just make sure you are using a plugin for this and not just pasting it into HTML template.
 
I want to place {join_date2} at mij 'rankings' page, so what name should I give the plugin file?
The content is

$TMPL['join_date2'] = date('d-M-Y', strtotime($join_date));

Is that right?
 
close.

{join_date2} should be {$join_date2}

and you need to ensure $join_date has a value.
 
I don't have enough information about what you have done to help you further.
 
Here is an existing plugin which does what you want, either use it out of the box or use it to learn and set up your own :)

Few things, you dont need $TMPL['join_date2'] , you can use the existing $TMPL['join_date'] to overwrite it display value
strtotime($join_date) should be strtotime($TMPL['join_date'])

As seen in the plugin files ( one for stats, one for rankings )
 

Attachments

Back
Top