× 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.



Thanks all for the ideas.

Great catch Adam. I programmed an airline ticketing system long ago and
was caught by something similiar to this.

It is unlikely, but I think I will do it anyway.

This seems like the best
D SYSYMD S 6 0
D SYSTIME S 6 0
D SYSDATETIME S Z
/FREE

//if the midnight thing is an
issue
SYSDATETIME = (%TIMESTAMP) ;
SYSYMD = %DEC(%DATE(SYSDATETIME):*YMD );
SYSTIME = %DEC(%TIME(SYSDATETIME):*HMS );

// if not
SYSYMD = %DEC(%DATE():*YMD );
SYSTIME = %DEC(%TIME():*HMS );

/END-FREE
Jim Horn

This email is intended only for the person or entity
to which it is addressed and may contain information
that is privileged, confidential or otherwise protected
from disclosure. If you are not the named addressee
or an employee or agent responsible for delivering
this message to the named addressee, you are not
authorized to read, print, retain copy, and disseminate
this message or any part of it. If you have received this
message in error please notify us immediately by email,
discard any paper copies and delete all electronic files
of this message.
message: 4
date: Fri, 14 Dec 2007 07:09:58 -0800 (PST)
from: Bill Wragg <bill_wragg@xxxxxxxx>
subject: Re: getting system date and system time

D SYSTIM 6 0
D SYSDTE 6 0

SysDte = %Dec(%Date():*Mdy); // SysDte = MMDDYY
SysTim = %Dec(%Time():*Hms) // SysTim = HHMMSS

Or use and other *Format you choose


Good Luck
Bill
(All else fails READ THE INSTRUCTIONS)

message: 6
date: Fri, 14 Dec 2007 10:28:24 -0500
from: Adam Glauser <adamglauser@xxxxxxxxxxxx>
subject: Re: getting system date and system time

Others have show less complicated syntax to get the date and time in
individual operations.

If there's any chance the job in question can run near midnight, it
might be wise to do this instead:

sysDateTime = %timestamp();
sysDate = %date(sysDateTime);
sysTime = %time(sysDateTime);

Suppose that your given code runs at 12:59:59.999999, lets say on
2007-12-14. You have the chance that SYSYMD = d'2007-12-14' and SYSTIME
= '00:00:01'. Of course, this is so unlikely that you may decide to
ignore this possibility, but in some situations it is critical to
consider this.

HTH,
Adam



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.