Jump to content

formatting mktime


CanMan2004

Recommended Posts

Hi all

I have a php page which I print todays mktime, the value im left with it something like

1167609600

It prints this in the url, such as

[code]www/checkdate.php?date=1167609600&area=2[/code]

How can I convert this so that I can print the month value (ie: 11 for November, 06 for June) and then print the year value (ie: 2007).

Can anyone help me? Getting totally stuck on this

Thanks in advance

Dave
Link to comment
https://forums.phpfreaks.com/topic/36387-formatting-mktime/
Share on other sites

Yes, pass the timestamp into the date function.

You can format it, using hte modifiers in this reference on the php manual.
http://us2.php.net/manual/en/function.date.php
It will be
$date = date("modification based on that table goes here""timestamp", "modification based on that table goes here");
Link to comment
https://forums.phpfreaks.com/topic/36387-formatting-mktime/#findComment-173078
Share on other sites

Archived

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

×
×
  • Create New...

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.