Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Decrypt a date stored in a MySQL varchar

Posted on 2004-10-15
3
Medium Priority
?
459 Views
Last Modified: 2006-11-17
Hi all,

I currently use postNuke and its module pnCommerce, and in a MySQL (MyISAM) table, some dates are stored in varchar(100) columns.

Therefore I have values such as :
- 1081977682
- 1086186475

As you can see, it is difficult to understand.

Do you know a method to translate in a "readable" format ?

TIA
0
Comment
Question by:Richard Coffre
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 
LVL 27

Accepted Solution

by:
Diablo84 earned 2000 total points
ID: 12319836
They are just unix timestamps so you can use the date function to format them. eg:

$stamp = "1081977682";
echo date("d-m-Y",$stamp);
0
 
LVL 27

Expert Comment

by:Diablo84
ID: 12319847
0
 
LVL 27

Expert Comment

by:Diablo84
ID: 12319876
basically the first parameter is the format and the second is the timestamp

So within the first parameter you can build a formated date from the stamp using the format characters (as shown in the manual page). My example above will return the date in dd-mm-yyyy format, a more extended example from the manual:

echo date("l dS of F Y h:i:s A");

will return the date in a format similar to: Wednesday 15th of January 2003 05:51:38 AM
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question