sobrenome Posted May 10, 2015 Share Posted May 10, 2015 On custom database template, date is parsed by:{datetime="$record->record_publish_date"}Which results in:<time datetime="2013-09-21T03:42:47Z" title="09/21/2013 12:42 AM" data-short="Sep 13">21 Sep 2013</time>I want to retrieve only the straight date of publishing and updating in this format:2009-05-08It's for micro data purposes.Anyone can help? Thanks. Link to comment Share on other sites More sharing options...
sobrenome Posted May 12, 2015 Author Share Posted May 12, 2015 Anyone? Link to comment Share on other sites More sharing options...
Wayne B Posted May 12, 2015 Share Posted May 12, 2015 {datetime="$record->record_publish_date"|raw}try this Link to comment Share on other sites More sharing options...
sobrenome Posted May 13, 2015 Author Share Posted May 13, 2015 It gives something like this:1408594320But how to get like this:2009-05-08 Link to comment Share on other sites More sharing options...
BomAleold Posted May 13, 2015 Share Posted May 13, 2015 It gives something like this:1408594320But how to get like this:2009-05-08 try with {date="..." dateonly="true"}http://community.invisionpower.com/4docs/advanced-usage/development/template-tags-r76/ Link to comment Share on other sites More sharing options...
sobrenome Posted May 13, 2015 Author Share Posted May 13, 2015 Almost there! Now it gives: 08/21/2014 Link to comment Share on other sites More sharing options...
opentype Posted May 13, 2015 Share Posted May 13, 2015 If you want a custom date output in just one place, you would need to run the Unix timestamp (e.g. “1408594320”) through PHP’s date function. http://php.net/manual/en/function.date.php Link to comment Share on other sites More sharing options...
sobrenome Posted May 13, 2015 Author Share Posted May 13, 2015 Thanks!and how to get the updated date? Link to comment Share on other sites More sharing options...
sobrenome Posted May 14, 2015 Author Share Posted May 14, 2015 Works great:{{$datePublished = date ("Y-m-d", $record->record_publish_date);}} <meta itemprop="datePublished" content="{$datePublished}">What about date updated? Link to comment Share on other sites More sharing options...
opentype Posted May 14, 2015 Share Posted May 14, 2015 Those are all the date fields:record_publish_daterecord_savedrecord_updatedrecord_last_commentrecord_last_reviewrecord_edit_time Link to comment Share on other sites More sharing options...
sobrenome Posted May 14, 2015 Author Share Posted May 14, 2015 Thanks!! Is there any documantation about? Link to comment Share on other sites More sharing options...
opentype Posted May 14, 2015 Share Posted May 14, 2015 I looked it up in phpMyAdmin. It’s just the names of the actual database columns. Link to comment Share on other sites More sharing options...
sobrenome Posted May 15, 2015 Author Share Posted May 15, 2015 Perfect! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.