Solved

Unix Timestamp conversion to dateTime in Crystal reports problem

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
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 …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

896 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

18 Experts available now in Live!

Get 1:1 Help Now