Jump to content

Archived

This topic is now archived and is closed to further replies.

cturner

Converting mktime to a normal date

Recommended Posts

Can someone please tell me how I can convert a mktime date (mktime(0,0,0,$month -1,$d,$year)) to something like 21 October 2006? Thanks in advance.

Share this post


Link to post
Share on other sites
Use [url=http://php.net/date]date()[/url]

eg:
[code]<?php
echo date("d F Y", mktime(0, 0, 0, $month -1, $d, $year));
?>
[/code]

Share this post


Link to post
Share on other sites
Thanks for your reply heckenschutze but it is displaying 0 as the 1st day of a month. I am clicking on a date in a calendar to come to the code that is below.

[code]
require "config.php";

// get the entry date
$entry_date = $_GET['entry_date'];

// select the diary entry for the entry_date
$query = "SELECT * FROM `diary_contents` WHERE `date` = '$entry_date'";

// display the diary entries for the entry date
echo date("w F Y", $entry_date);

// more code to come
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.