Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

convert time to date

Former Member
0 Likes
2,075

Is it possible to convert time to date and vice versa. if yes how??

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,981

what time do u need to convert.

see if this fm helps u

ADDR_CONVERT_TIMESTAMP_TO_DATE.

кu03B1ятu03B9к

what time do u need to convert.

see if this fm helps u

ADDR_CONVERT_TIMESTAMP_TO_DATE.

кu03B1ятu03B9к

13 REPLIES 13
Read only

Former Member
0 Likes
1,981

Hi,

There is no conversion from date to time and viceversa

Read only

Former Member
0 Likes
1,982

what time do u need to convert.

see if this fm helps u

ADDR_CONVERT_TIMESTAMP_TO_DATE.

кu03B1ятu03B9к

Read only

Former Member
0 Likes
1,981

Hi,

Plese refer this link.It may be usefull to u...

http://help.sap.com/abapdocu/en/ABAPCONVERT_TIME-STAMP.htm

Regards

Kiran

Edited by: Kiran Saka on Feb 7, 2009 7:41 AM

Read only

Former Member
0 Likes
1,982

Hi Nilesh ,

U cant convert time to date .

example: 12:00 am comes every day. but the data 12 feb2009 will not.but there is a facility to convert timestamp to date .

Can you please let me know the business scenario u required this??

Thank you,

Neelima.

Read only

Former Member
0 Likes
1,982

hi,

Its not possible to have conversions between time and date fields, because both are incompatible fields.

This can be known with respect to the inbuilt lengths of fields.

Time internally stored as HHMMSS of length fixed 6.

Date internally stored as YYYYMMDD of length fixed 8.

Thanks

Sharath

Read only

Former Member
0 Likes
1,982

Hi,

Yes we can convert time to date....

the following code is :

data :

w_date like sy-datum,

w_int type i,

w_time like sy-uzeit.

w_time = sy-uzeit.

w_int = w_time.

move w_int to w_date.

write : w_date.

though it may not be the date you want to see... but still you can get the date.

and then you can do any kind of manipulations with that date.

Regards,

Ravi

Read only

Former Member
0 Likes
1,982

Hi,

It is not possible to convert date into time because

Internam format of date is YYYYMMDD which has fixed length 8.

Time is HHMMSS which has fixed length 6.

Regards,

Rajani

Read only

Former Member
0 Likes
1,982

Hi,

Try this

IB_CONVERT_FROM_TIMESTAMP

Regards,

Manish

Read only

Former Member
0 Likes
1,982

This message was moderated.

Read only

0 Likes
1,982

Hi Sam,

This link has already been provided by kiran above, so was there any need for u to post it again?

кu03B1ятu03B9к

Read only

Former Member
0 Likes
1,982

Hi Nilesh ,

Though taking type as 'T' or 'D' you cannnot convert time and date but you can take a type say 'C' or 'I' or any other type and then do it like T - C - D something like that .

Hope it helps!

Much Regards,

Amuktha .

Read only

Former Member
0 Likes
1,982

Hi,

Check this links to get more about date conversion.

http://www.sap-basis-abap.com/sapab015.htm

Hope it will help you.

Regards:

Alok

Edited by: Alok Bansal on Feb 9, 2009 10:32 AM

Read only

Former Member
0 Likes
1,982

Hi,

Just try this function module.

DATE_TIME_CONVERT

This gives Time (seconds since reference date)

Or else you can use these function modules:

PK_DATE_TIME_INTO_TIMESTAMP -- Converts the date and time into TimeStamp.

PK_TIMESTAMP_INTO_DATE_TIME --- Converts Time Stamp into date and time.

Thanks,

Shiny