DeveloperSide.NET Forums
January 19, 2020, 09:21:56 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: MySQL timestamp conversion problem  (Read 10819 times)
0 Members and 1 Guest are viewing this topic.
rowlandk
Member
*
Posts: 9

7367666 rowland5@chartermi.net rowlandk83
View Profile WWW
« on: April 30, 2004, 09:35:03 PM »

Hello,

I am trying to convert a MySQL Unix timestamp into a readable format for display, my code is as follows.

$timestamp = 20040430153116;

echo strftime("%B %d, %Y - %I:%M %p", $timestamp);


It displays January 18, 2038 - 10:14 pm

I have no idea why?

any help?

I am running MySQL version 4.0.18 and php 4.3.4

thanks
Logged

HP, Apache, and MySQL newb
Anonymous
Guest
« Reply #1 on: May 01, 2004, 03:25:15 AM »

There are all kinds of conventions on times/dates/timestamps....

I would start with...

http://us4.php.net/strftime

...but you probably were already there.
Logged
Anonymous
Guest
« Reply #2 on: May 01, 2004, 03:32:13 AM »

You could play around with something like...

Code:
echo strftime("%B %d, %Y - %I:%M %p", strtotime("01/18/2038"))
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!