Storing Time (format) in an Alpha field, then retrieving it

Hello -

I have a client who, inexplicably (to me) stores both the date and the time in (T) fields.

For instance, they’ll do something like

Move *DATX to #TimeField(T)
add 720000 to #TimeField

WRITE #TIMEFIELD (EM=MM-DD-YY,HH:II:SS.T)
will produce
05-22-06,20:00:00.0

They want me to store this date/time hybrid in an alpha field (an A100), then retrieve it later for comparison to a T field from another file. Moving the Time field to the alpha field is not the problem I’m having (obviously). It’s later, when I want to pull it back out and throw it into a local time variable and compare it to the other time field. I’m not able to move the alpha into a time field. I’ve tried a variety of things, but to no avail.

Okay - there’s the background. The question is this -

Is there an edit mask by which I can move the alpha into the time? If it was simply the time I could say MOVE EDITED #ALPHAFIELD TO #NEWTIMEFIELD (EM=HHIISS). But, it’s not and I’ve not found in any documentation about a date/time mask.

Hope I was clear in my explanation and that someone can help.

Thanks.

To extract the time value, you need to use the same edit mask as was used to create the alpha field.

Using your example of MM-DD-YY,HH:II:SS

[code]
DEFINE DATA LOCAL
1 #T (T) INIT <*TIMX>
1 #A (A20)
1 #GET (T)
END-DEFINE
*
MOVE EDITED #T (EM=MM-DD-YY,HH:II:SS.T) TO #A
MOVE EDITED #A TO #GET (EM=MM-DD-YY,HH:II:SS.T)
DISPLAY #T (EM=MM-DD-YY

Yes, that works very well (and makes much sense!).

Thanks, Ralph.

By the way, are you really using a literal for the time? It isn’t obvious that 720000 is 8 pm (20 hours x 60 minutes x 60 seconds x 10ths).

Why not set a time variable to 8 pm? It’s much more readable.

[code]
DEFINE DATA LOCAL
1 #T (T)
1 #H (T)
END-DEFINE
*
ASSIGN #T = *DATX
WRITE ’ Date’ #T (EM=MM/DD/YYYY

Actually, I copied that 720000 bit from the code that stores the compare field in one of their programs. They’re quite sticky about coding with their methodology.

???

Thanks for the note, though.