Solved

Unix Timestamp conversion to dateTime in Crystal reports problem

Posted on 2004-04-20
4
1,888 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
ID: 10870889
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
ID: 10870957
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

772 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