Focal Point
Dates with seconds

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3811019331

November 01, 2005, 05:27 PM
Pam Kratt
Dates with seconds
I've been reading all day everything I can find in the forum and on the website on dates, but nothing I seem to try works and I can't figure out why.

I need to do the following:
1. Have the date display in this format 10/03/2005 14:36:20 PT. My problem is getting the PT (time zone) on the end. When ever I try to edit or chgdat my data, I get an error. If I put it in this format DTTIME/A25= EDIT (DATE_TIME1, '9999/99/99 99:99:99') | ' PT'; it works just fine. If I change the 9999/99/99 to 99/99/9999 it puts the date as 20/05/1003. CURRTIME (below) displays the date/time correctly it just doesn't have the PT on the end. DATE_TIME2 AND DTTIME2 is just to try and get the PT. This shouldn't be that hard.
CURRTIME/HMDYYS=CURRENT_TIMESTAMP;
DATE_TIME2/A20= HCNVRT (CURRTIME, '(H17)' , 17, 'A20');
DTTIME2/A25= EDIT (DATE_TIME2, '99/99/9999 99:99:99') | ' PT';month/day/year

Any suggestions?
November 01, 2005, 06:55 PM
Francis Mariani
This works:

DEFINE FILE CAR
DT1/HYYMDS = HINPUT(14,'20010721124508', 8, 'HYYMDS');

CURRTIME/HMDYYS=DT1;
DATE_TIME2/A20= HCNVRT (CURRTIME, '(HMDYYS)' , 20, 'A20');
DTTIME2/A25= DATE_TIME2 | ' PT';
END
TABLE FILE CAR
PRINT
DT1
CURRTIME
DATE_TIME2
DTTIME2
BY COUNTRY
END
November 01, 2005, 07:15 PM
Pam Kratt
Thank you thank you!!! That worked perfectly.
November 01, 2005, 07:27 PM
Francis Mariani
You can eliminate one compute statement:

DEFINE FILE CAR
DT1/HYYMDS = HINPUT(14,'20010721124508', 8, 'HYYMDS');

CURRTIME/HMDYYS=DT1;
DATE_TIME2/A25= HCNVRT (CURRTIME, '(HMDYYS)' , 20, 'A20') | ' PT';
END
TABLE FILE CAR
PRINT
DT1
CURRTIME
DATE_TIME2
BY COUNTRY
END