- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 01-11-2020 09:07 PM
(3194 views)
Hi there,
I have the date time format as '1/11/2017 8:00:41 AM +00:00' and it is in character format. I don't there this '+00:00' came from, but in my all data they all end with '+00:00', so I really don't care.
can someone help me convert it to Datetime format like '1/11/2017 8:00:41 AM' please?
DATA Have;
Date_Time='1/11/2017 8:00:41 AM +00:00';
RUN;
Thanks.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
DATA Have;
Date_Time='1/11/2017 8:00:41 AM +00:00';
RUN;
data want;
set have;
want_date=input(date_time,mdyampm23.);
format want_date DATEAMPM. ;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi I have a similar question . How to convert 28-APR-20 02.56.42.897749 PM ( length is 28 char) to DATETIME ? Please can you help
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @dennis_oz Would the below suffice?
data w;
have='28-APR-20 02.56.42.897749 PM';
want=input(have, datetime30.);
format want datetime30.;
run;