venerdì 23 dicembre 2016

Oracle Tips: conversione secondi in formato HH:MM:SS

create or replace function sec2time (sec in number) return varchar2 is seconds number; hours_var number; minutes_var number; seconds_var number; output_var varchar2(32); begin if (nvl(sec,0)=0) then return 'ND'; end if; seconds := abs(sec); hours_var:= trunc (seconds / 3600); minutes_var:= trunc((seconds - (hours_var*3600))/60); seconds_var := seconds - (hours_var*3600) - (minutes_var*60); output_var := to_char(hours_var,'00')||':'||to_char(minutes_var,'00')||':'||to_char(seconds_var,'00'); return(replace(output_var,' ','')); end;

Nessun commento:

Best dns 2023

  Best Free & Public DNS Servers Provider Primary DNS Secondary DNS Google 8.8.8.8 8.8.4.4 Control D 76.76.2.0 76.76.10.0 Quad9 9.9.9.9 ...