Jump to content

How do you turn a timestamp into a date


kpetsche20

Recommended Posts

    * r: Displays the full date, time and timezone offset. It is equivalent to manually entering date("D, d M Y H:i:s O")

 

Time:

 

    * a: am or pm depending on the time

    * A: AM or PM depending on the time

    * g: Hour without leading zeroes. Values are 1 through 12.

    * G: Hour in 24-hour format without leading zeroes. Values are 0 through 23.

    * h: Hour with leading zeroes. Values 01 through 12.

    * H: Hour in 24-hour format with leading zeroes. Values 00 through 23.

    * i: Minute with leading zeroes. Values 00 through 59.

    * s: Seconds with leading zeroes. Values 00 through 59.

 

Day:

 

    * d: Day of the month with leading zeroes. Values are 01 through 31.

    * j: Day of the month without leading zeroes. Values 1 through 31

    * D: Day of the week abbreviations. Sun through Sat

    * l: Day of the week. Values Sunday through Saturday

    * w: Day of the week without leading zeroes. Values 0 through 6.

    * z: Day of the year without leading zeroes. Values 0 through 365.

 

Month:

 

    * m: Month number with leading zeroes. Values 01 through 12

    * n: Month number without leading zeroes. Values 1 through 12

    * M: Abbreviation for the month. Values Jan through Dec

    * F: Normal month representation. Values January through December.

    * t: The number of days in the month. Values 28 through 31.

 

Year:

 

    * L: 1 if it's a leap year and 0 if it isn't.

    * Y: A four digit year format

    * y: A two digit year format. Values 00 through 99.

 

 

Credits to Tizag.com

Link to comment
Share on other sites

THORPE STOP RESPONDING YOU ADVICE IS NOT HELPFUL. I tried using the date() and it doesn't convert my timestamp into a date.

 

Lol...  This is what date() is used for.  It's tricky cause the name throws you off...

 

Post your code!

Link to comment
Share on other sites

THORPE STOP RESPONDING YOU ADVICE IS NOT HELPFUL. I tried using the date() and it doesn't convert my timestamp into a date.

 

date

 

string date  ( string $format  [, int $timestamp  ] )

 

weird how the second aRGUMENT IS A FREAKING TIMESTAMP.  POST SOME FREAKING CODE BEFORE YOU START YELLING.

Link to comment
Share on other sites

kpetsche20:

 

1) Don't be ignorant, it happened twice in this thread.

2) Learn how to ask a question.

3) Post your code, rather than saying, "it doesn't convert my date!@#$!".

4) Look it up yourself.  This is a very common issue.

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.