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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.