|
I hope I don't get beat up over this, but I wouldn't write a subprocedure.
Instead, use this data structure (if you can) in your calling program.
D DS
D#DateTime Z
D #Date D Overlay(#DateTime)
D #Time T Overlay(#DateTime:12)
Now you are only two statements away from what you want:
C Time #DateTime
C Move #Date #DateANY
***OR***
C Eval #DateANY = #Date
You define #DateANY to be whatever format you need.
Will this work for you?
Patrick Conner
www.ConnecTown.com
(828) 244-0822
__________________
sure.
here is the prototype.
D GCurrDate PR D
D Dt_Fmt 4 Value
here is the procedure
PGCurrdate B Export
*
* Input Values
*
D GCurrDate PI D
D Dt_Fmt 4 Value
*
D DateMDY S D datfmt(*mdy)
D DateDMY S D datfmt(*dmy)
D DateYMD S D datfmt(*ymd)
D DateJUL S D datfmt(*jul)
D DateISO S D datfmt(*iso)
D DateUSA S D datfmt(*usa)
D DateEUR S D datfmt(*eur)
D DateJIS S D datfmt(*jis)
D DateAlpha S D Inz
D ds
D TimeDate 14 0
D Time60 6 0 overlay(TimeDate: 1)
D Date80 8 0 overlay(TimeDate: 7)
*----------------------------------------------------*
* Get the current time *
*----------------------------------------------------*
C Time TimeDate
C Select
C When Dt_Fmt = '*MDY'
C *usa Move Date80 DateMDY
C Movel DateMDY DateAlpha
*
C When Dt_Fmt = '*DMY'
C *usa Move Date80 DateDMY
C Movel DateDMY DateAlpha
*
C When Dt_Fmt = '*YMD'
C *usa Move Date80 DateYMD
C Movel DateYMD DateAlpha
*
*
C When Dt_Fmt = '*JUL'
C *usa Move Date80 DateJUL
C Movel DateJUL DateAlpha
*
C When Dt_Fmt = '*ISO'
C *usa Move Date80 DateISO
C Movel DateISO DateAlpha
*
C When Dt_Fmt = '*USA'
C *usa Move Date80 DateUSA
C Movel DateUSA DateAlpha
*
C When Dt_Fmt = '*EUR'
C *usa Move Date80 DateEUR
C Movel DateEUR DateAlpha
*
*
C When Dt_Fmt = '*JIS'
C *usa Move Date80 DateJIS
C Movel DateJIS DateAlpha
C EndSl
*
C Return DateAlpha
P GCurrDate E
here is the pertinent pieces from the call
D#CURRENT S D
EVAL #CURRENT = GCURRDATE('*MDY')
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.