b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Developer Reference
  3. Website Skins/Themes
  4. Skin Tags / API
  5. Item Tags
  6. Template Tag: Item Issue Date

Template Tag: Item Issue Date

This tag displays the Post/Item’s issue date and/or time.

Example

Quick Template

[Item:issue_date|date_format=#short_date]

PHP Template

$Item->issue_date( array( 'date_format' => '#short_date' ) );

Parameters

Param

Default

Usage

before

' '

Displayed before the issue date

after

' '

Displayed after the issue date

date_format

#

Specify # to use this tag’s default format: #short_date. Other possible values: #short_date, #long_date, #extended_date, #short_time, #long_time, #short_date_time. See Date Format.

use_GMT

false

Use GMT/UTC

Return value

This tag displays content only, it does not have a return value.


Frequently Asked Questions (FAQs)

To give an example, here is a question from the forum:

Is there any way that I could add something so it shows as:
Day 331 of Week 48 Wednesday November, 28 2007

This is the answer:

Find your skin, crack open index.main.php, Find and replace something similar to this:

  $Item->issue_date( array(
      'before'      => ' ',
      'after'       => ' ',
      'date_format' => '\D\a\y z \o\f \W\e\e\k W\, l F\, d o',
  ) ); 

To understand this code: the \ escapes the character after it. I used it too often. Characters that are not escaped represent PHP’s Date / Time arguments. See Date Format for more information about the date and time format.

Some skins have the date in an image / icon. To do that you can use multiple $Item->issue_date() calls like so:

<ul class="datetime"> 
      <li class="month"> 
		<?php
			$Item->issue_date( array(
				'before'	=> '',
				'after'		=> '',
				'date_format'	=> 'm',
	    		        )
			);
		?> 
	</li> 
	<li class="day">
		<?php 
			$Item->issue_date( array(
				'before'	=> '',
				'after'		=> '',
				'date_format'	=> 'd',
				)
			);
		?>
	</li> 
</ul>

This is an example style:

ul.datetime {
	background: url(images/calendar-blue.png);
	background-repeat: no-repeat;
	width: 66px;
	height: 67px;
	text-align: center;
	float: left;
	color: white;
	font-size: 10px;
	font-weight: bold;
	margin: 0px;
	margin-top: 3px;
	margin-right: 10px;
	padding-top: 1px;
	margin-bottom: 0px;
}

li.month {
	list-style: none;
	padding-top: 0px;
	margin-top: 0px;
}

li.day {
	font-size: 35px;
	font-weight: bold;
	color: rgb(65, 65, 65);
	padding-top: 8px;
	padding-bottom: 0px;
	margin-bottom: 0px;
	letter-spacing: -1px;
	list-style: none;
}

You can also call issue_date property which returns it as a string in a DateObject format and retrieve a specific part of the date from it.
This is useful if you want to use the post item’s date for adding some programmable logic based on the date rather then just print it out.

 $issueDate = new DateTime($Item->issue_date);
 $issueDayOfMonth = $issueDate->format('j');
 echo $issueDayOfMonth;

Created by fatimahnasra • Last edit by winskie on 2020-05-01 05:29 • •

2 comments

Comment from: christoph.cemper

Christoph Cemper

This needs a link to the page describing B2 specific time formats… where is it?

Possible values: #, #short_date, #long_date, #extended_date, #short_time, #long_time, #short_date_time
2020-04-30 @ 13:54

Comment from: fplanque

Coming later this week ;)

2020-04-30 @ 16:17

On this page

  • Example
  • Quick Template
  • PHP Template
  • Parameters
  • Return value
  • Frequently Asked Questions (FAQs)

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
    • Website Skins/Themes
      • Skin Development Primer
      • Loading additional resources into a skin
      • Where are the skin files?
      • CSS Guidelines
      • Targeted CSS Selectors
      • Introducing evoSkins
      • Modifying evoSkins
      • Creating evoSkins
      • Skin Tags / API
        • Template functions
        • Template Tags
        • Tag Plugins Call By Code
        • Tag User Subs Link
        • Tag User Register Link
        • Tag User Profile Link
        • Tag User Logout Link
        • Tag User Login Link
        • Tag Skin Get URL
        • Tag Skin Get Path
        • Tag Skin Container
        • Tag Powered By
        • Tag Is Logged In
        • Include Disp
        • Tag Display If Empty
        • Tag Comment Allowed Tags
        • Tag Blog Tagline
        • Tag Blog Name
        • Tag Blog Longdesc
        • Tag Blog Home Link
        • Tag Blog Footer
        • Tag Blog Contact Link
        • app_version();
        • Tag Request Title
        • Include Item Content
        • User::get_identity_link()
        • Item Tags
          • Anchor -
          • Author +
          • Categories +
          • Category Name+
          • Content Teaser +
          • Contents Last Updated +
          • Creation Time +
          • Custom Fields +
          • Edit Link +
          • Excerpt +
          • Extra Status -
          • Feedback Feed Link -
          • Feedback Link +
          • Files +
          • Flag +
          • Footer +
          • Has Feedback Raw -
          • History Link +
          • ID +
          • Image URL +
          • Images +
          • Intro-Tag
          • Lang Raw -
          • Locale Flag +
          • Locale Raw -
          • Main Category -
          • Mod Time -
          • More Link +
          • Msgform Link +
          • Msgform Link Assigned !
          • Page Links +
          • Permanent Link +
          • Permanent URL -
          • Priority -
          • Propose Change Link +
          • Publish Link !
          • Read Status +
          • Tag Item Can Comment
          • Tag Item Can Rate
          • Tag Item Can Recieve Pings
          • Tag Item Deadline Date
          • Tag Item Deadline Time
          • Tag Item Deprecate Link
          • Tag Item Feedback Moderation
          • Tag Item Language
          • Tag Item Locale Temp Switch
          • Tags +
          • Template Tag: Item Background Image CSS
          • Template Tag: Item Content Extension
          • Template Tag: Item Custom
          • Template Tag: Item Issue Date
          • Template Tag: Item Issue Time
          • Template Tag: Item Last Edit User
          • Template Tag: Item Last Touched
          • Template Tag: Item Mod Date
          • Template Tag: Item Refresh Contents Last Updated Link
          • Title +
          • Trackback RDF Raw -
          • Trackback URL Raw -
          • Type Raw -
          • Visibility Status +
          • Visibility Status Raw -
          • Wordcount Raw -
        • Category Tags
        • User Tags
        • Other Tags
      • Styling widgets
      • Skin Quality Control
      • Using HTML 5 tags
      • Using Custom Item Templates
      • Using bootstrap classes in footers
      • Using Grunt
      • Dev Menu
      • How to add a Google Font (WebFont) ?
      • Custom Fields in a Template
      • Site Skins
    • Email Skins/Themes
    • b2evolution Files
    • Website Integration
    • Plugins
    • Debugging
    • Technical Reference
    • Hacks
    • Credits
    • Development
    • How to... (Customize)
    • Scheduled Tasks Reference
  • Operations Reference
  • Advanced Topics
  • Glossary
  • Archives
Photo gallery software

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque