Solved

Unix Timestamp conversion to dateTime in Crystal reports problem

Posted on 2004-04-20
4
1,929 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
[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
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …

752 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