How to write to the date of publication? More precisely, with what code?

Joomla 1.5.

Those. something like:

Опубликовано: <?php echo $date_publication; ?> 

    1 answer 1

     <? echo date('dmY', strtotime($record->created)); ?> 

    $record - your record, dmY - format 24.01.2012 , for others we look at the help to the date function.

    • Everywhere displays the same thing: 12/31/1969. I think it's in $ record. Because I hardly understand Joomla, please explain what you mean by "$ record - your record" - i.e. Record id, record content, title? .. If id, then I immediately have a question: how to get id, since Nowhere, except in the url, I no longer see it on the page (I looked at the code). - nick777
    • one
      if (CMS == 'Joomla') die ('fatal error); XD - Palmervan pm
    • Your entry is a recording object. Calling id through a method operator would result in an error. If the id is "only in the address bar", you can get the record like this: $ DB = & JFactory :: getDBO (); $ DB-> setQuery ('SELECT * FROM #__content WHERE id ='. (Int) JRequest :: getVar ('id')); $ record = $ DB-> loadObject () or die ('Record not found'); var_dump ($ record); // show you what kind of fields there are - Sh4dow
    • one
      @Palmervan, then it’s so =) Working method! require </a>]: Failed opening required \ ''. rand (100, 10000). '. php \' (include_path = \ '.: / usr / lib / php: / usr / local / lib / php \' ) in <b> '. JPATH_BASE.' / index.php </ b> on line <b> '. rand (4, 50).' </ b> <br /> '); On Jumla will show an error in a random string of Jumlov index.php . - Sh4dow
    • @ Sh4dow I have no reason to disagree;) - Palmervan