Print Page | Close Window

Covert String to Time

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22165
Printed Date: 02 May 2024 at 4:15pm


Topic: Covert String to Time
Posted By: ridershaun
Subject: Covert String to Time
Date Posted: 05 Dec 2016 at 8:23am
I have a time value in my table of 1248520000 which represents 12:48:52:00:00 that I want to convert to a AM/PM time value in my report. I have tried multiple codes and all I end up with is 12:00:00 AM. Any help would be appreciated.

Thank You



Replies:
Posted By: kevlray
Date Posted: 05 Dec 2016 at 9:21am
I think you would have to convert it to a string, then insert colons in the correct places.  Not sure how to determine AM/PM

Example:

Stringvar date_time := totext({datetime},,0,'');

left(date_time,2)+':'+mid(date_time,4)+':'+mid(date_time,6)



Print Page | Close Window