WordPress Shortcode: Display the post modified time [moddate]

This shortcode will display the post’s last modified timestamp. By default it will display the timestamp in the date & time format that you specify in your blog settings.

If you wish to change it you can use the format=”” option to display the date and time any way you want. (Examples: May 4, 2010 6:41 pm or 2010/05/04 18:41 etc…)
Visit the php date() function page for information on different formats.

Just insert the following code to the bottom of your functions.php file.

function jason_moddate($atts) {
	global $post;
	extract(shortcode_atts(array('format' => get_option("date_format") . " " . get_option("time_format")), $atts));
	return date($format, strtotime($post->post_modified));
}
add_shortcode('moddate', 'jason_moddate');

Now you can use [moddate] anywhere inside your posts or pages:

This post was last modified on [moddate]

Will get you:

This post was last modified on May 5, 2010 2:08 am

Format Examples:

Display just the date:

[moddate format="Y-M-D"]
2010-May-Wed

Display just the time:

[moddate format="h:i:s a"]
02:08:40 am

Combine them together for a full timestamp:

[moddate format="Y-M-D h:i:s a"]
2010-May-Wed 02:08:40 am

Created on WordPress version 2.9.2

Welcome

Just made this site. Not quite ready.

Haven’t uploaded all the contents yet. I’m slowly moving everything over from teknidude.com to this new format while messing around with wordpress. The site design will change along with everything else shortly. Check back soon.

Thanks,
Jason

WinampController v1.5.0

Mobile Device:


Web Browser:


[Control via any web browser] Continue reading ‘WinampController v1.5.0’

Hostname Resolve v1.0.6

Program  Screenshot 18KB
Resolve hostnames to IP’s and vice versa.
supports command-line arguments!!

Size: 9KB zipped
Version: 1.0.6
[Download This Program]

Port Scan v1.0.0

Program  Screenshot 11KB
Size: 7KB zipped
Version: 1.0.0
[Download This Program]