You will need to convert this source string to a pattern for which there is a SAS infomat. Let me know if below conversion is working for you.
data demo;
input have_string $25.;
have_string=prxchange('s/^(\d+-\d+-\d+).(\d+).(\d+).(\d+.*)$/$1T$2:$3:$4/oi',1,strip(have_string));
have_dttm=input(strip(have_string),e8601dt26.6);
/*Get the current timestamp*/;
Current_time = DATETIME();
/* subtract 14 hours (50400 seconds) */
_14_hours_ago = intnx('dthour',current_time,-14,'s');
datalines;
2023-09-05-06.15.16.130035
2023-09-05T06:15:16.130035
;
proc print data=demo;
format have_dttm Current_time _14_hours_ago datetime25.6;
run;