November 01, 2005, 05:27 PM
Pam KrattDates 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 MarianiThis 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 KrattThank you thank you!!! That worked perfectly.
November 01, 2005, 07:27 PM
Francis MarianiYou 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