kpetsche20 Posted December 23, 2008 Share Posted December 23, 2008 how do you turn a timestamp into a date to dispay the Y-m-d Quote Link to comment https://forums.phpfreaks.com/topic/138102-how-do-you-turn-a-timestamp-into-a-date/ Share on other sites More sharing options...
trq Posted December 23, 2008 Share Posted December 23, 2008 date Quote Link to comment https://forums.phpfreaks.com/topic/138102-how-do-you-turn-a-timestamp-into-a-date/#findComment-721907 Share on other sites More sharing options...
Twister1004 Posted December 23, 2008 Share Posted December 23, 2008 * 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 Quote Link to comment https://forums.phpfreaks.com/topic/138102-how-do-you-turn-a-timestamp-into-a-date/#findComment-721932 Share on other sites More sharing options...
kpetsche20 Posted December 23, 2008 Author Share Posted December 23, 2008 Anyone else have advice that is actually helpful, I need to know what function to use to turn a timestamp into a human readable date Quote Link to comment https://forums.phpfreaks.com/topic/138102-how-do-you-turn-a-timestamp-into-a-date/#findComment-721983 Share on other sites More sharing options...
trq Posted December 23, 2008 Share Posted December 23, 2008 date Quote Link to comment https://forums.phpfreaks.com/topic/138102-how-do-you-turn-a-timestamp-into-a-date/#findComment-721987 Share on other sites More sharing options...
kpetsche20 Posted December 23, 2008 Author Share Posted December 23, 2008 THORPE STOP RESPONDING YOU ADVICE IS NOT HELPFUL. I tried using the date() and it doesn't convert my timestamp into a date. Quote Link to comment https://forums.phpfreaks.com/topic/138102-how-do-you-turn-a-timestamp-into-a-date/#findComment-722638 Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 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! Quote Link to comment https://forums.phpfreaks.com/topic/138102-how-do-you-turn-a-timestamp-into-a-date/#findComment-722643 Share on other sites More sharing options...
flyhoney Posted December 23, 2008 Share Posted December 23, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/138102-how-do-you-turn-a-timestamp-into-a-date/#findComment-722645 Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 Assuming you can't figure this out... echo date('Y-m-d',$timestamp); Quote Link to comment https://forums.phpfreaks.com/topic/138102-how-do-you-turn-a-timestamp-into-a-date/#findComment-722646 Share on other sites More sharing options...
Jabop Posted December 23, 2008 Share Posted December 23, 2008 THORPE STOP RESPONDING YOU ADVICE IS NOT HELPFUL. I tried using the date() and it doesn't convert my timestamp into a date. Wow Quote Link to comment https://forums.phpfreaks.com/topic/138102-how-do-you-turn-a-timestamp-into-a-date/#findComment-722647 Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 He probably did: date($timestamp); Now magically do what I want! Quote Link to comment https://forums.phpfreaks.com/topic/138102-how-do-you-turn-a-timestamp-into-a-date/#findComment-722649 Share on other sites More sharing options...
revraz Posted December 23, 2008 Share Posted December 23, 2008 I doubt he even did that. He probably did: date($timestamp); Now magically do what I want! Quote Link to comment https://forums.phpfreaks.com/topic/138102-how-do-you-turn-a-timestamp-into-a-date/#findComment-722655 Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/138102-how-do-you-turn-a-timestamp-into-a-date/#findComment-722667 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.