×
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.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of DeLong, Eric
Sent: Thursday, February 07, 2008 11:29 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Building a timestamp from a date and time
Why not just
startTS = startDate + startTime;
Eric
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Adam Glauser
Sent: Thursday, February 07, 2008 11:18 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Building a timestamp from a date and time
I'm sure I'm missing something obvious, but I can't find anything
appropriate in the RPG Reference or the archives.
If startDate and startTime are D and T types respectively, what is the
simplest way to create a timestamp that represents that date/time? Here
is what I've got:
startTS = %timestamp(%char(startDate : *ISO) + %char(startTime : *ISO) +
'.000000');
I'm sure you'll agree this is less than ideal, if only because it is so
verbose. Other attempts were:
startTS = startDate + startTime;
startTS = %timestamp(startDate + startTime); startTS += startDate;
startTS += startTime;
I suppose one way that might work, since this is SQLRPGLE already would
be exec sql SELECT TIMESTAMP(:startDate, :startTime) FROM
sysibm/sysdummy1
INTO :startTS;
but it would be nice to have an non-SQL option.
--
As an Amazon Associate we earn from qualifying purchases.
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.