× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi,

I'd use embedded SQL:

The following SQL statement converts a timestamp (MyTs) into a character
representation for example "06:53 AM, Friday, April 9 2010"
Exec SQL Set :MyChar = Char(Time(:MyTS), USA) concat ', ' concat
DayName(:MyTS) concat ', ' concat
MonthName(:MyTS) concat ' ' concat
Cast(DayOfMonth(:MyTS) as VarChar(2))
concat ' ' concat
Cast(Year(:MyTS) as Varchar(4));

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"


-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von Paul Jackson
Gesendet: Friday, 09. April 2010 05:23
An: RPG400-L@xxxxxxxxxxxx
Betreff: Need help formatting a timestamp to long character

Hello,

I need to convert a 26 character system timestamp (Z type) to a string
that goes something like: "nn:nn AM/PM, Day name, Month name DD,
YYYY".

At first I saw the CEEDATE API and got excited as it seemed to be able
to output that format precisely and then noticed that it cannot take a
time as input, only Lilian days (which makes me wonder why it allows
you to specify the time symbols on the input picture string).

Anyway it looks like I can use CEEDATE to get the date part formatted
and then manually do the time section.

Just wondering if anyone has a better solution or suggestion, don't
want to reinvent the wheel as I'm sure this has been done elsewhere.

Thanks in advance.
-Paul

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.