Solved

Unix Timestamp conversion to dateTime in Crystal reports problem

Posted on 2004-04-20
4
1,842 Views
Last Modified: 2009-05-02
I am using mysql database and I am storing dates/times as unix timestamps (number of seconds since unix epoch, 1974?).  Anyways I am trying to convert these dates back into month, day, year hh:mm:ss format in crystal reports.  All the crystal report formula subroutines expect another data type than a unix timestamp, how would I go about getting them into the correct format?
0
Comment
Question by:matthew_newell
4 Comments
 
LVL 42

Accepted Solution

by:
frodoman earned 25 total points
Comment Utility
You'll need to do a formula to convert it.  The timestamp is a numeric value, right?  So something like this should work:

DateAdd("s",{table.secondsfield},DateValue(1974,1,1))

Basically use the dateadd function to add the number of seconds stored in the db to the datevalue for the beginning date.
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 25 total points
Comment Utility
Rather than having to create the formula for every report, you could build a User Function Library (UFL) and include it in your Crystal installation.

mlmcc
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now