cancel
Showing results for 
Search instead for 
Did you mean: 

Time Datatype

Former Member
0 Kudos

Hi All,

I want to display "from_time" and "To_Time". Is there a datatype which helps to display the "time alone"? The data type called "Timestamp" is displaying both date + time.

Could anyone say the datatype for this?

Regards,

Divya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Divya

There are three datatypes in oracle for time: DATE, TIMESTAMP and INTERVAL. You need to be a bit more precise on what you want to do.

But just some general hints:

- Example: you can display only the hour:min out of a date or timestamp type with to_char(mydate, 'HH24:MI:SS')

SQL> select to_char(sysdate,'HH24:MI:SS') from dual;

- In the SAP world date fields are mostly VARCHAR2 types like '20071116104417' . You can extract the time with substr(mydat,9,6) will take 6 characters from string position 9:

SQL> select substr('20071116104417',9,6) from dual;

- You can subtract to dates / timestamps and will end up with an interval. Subtracting two dates gives you just a number, which is no longer a date.

Regards Michael

Former Member
0 Kudos

HI ,

Here i dont want to get the system time. i want to enter time into the input field. So while declaring the variable for "TIME", what is the data type for that?

Regards,

Divya

Answers (2)

Answers (2)

Former Member
0 Kudos

answered

former_member204746
Active Contributor
0 Kudos

you should ask in a ABAP forum.