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

Time conversion not working

Former Member
0 Likes
1,485

Hello Everyone,

Have to convert time/date picked from table to user's time zone .

Tried IB_CONVERT_INTO_TIMESTAMP (Tried others too) .

Converted the time to GMTUK (+/- 0) and then to sy-zonlo.

But nothing seems to work.

Please help.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,432

I've just tried this and it works, what isn't working for you? The code which does the work is this:


    CONVERT DATE i_datlo TIME i_timlo
      INTO TIME STAMP e_timestamp TIME ZONE l_tzone.

Maybe you can insert this into your program directly?

14 REPLIES 14
Read only

former_member191735
Active Contributor
0 Likes
1,432

Try this

convert date l_date time l_time daylight saving time 'X'

into time stamp result-timestamp time zone sy-zonlo.

Good luck

Read only

Former Member
0 Likes
1,433

I've just tried this and it works, what isn't working for you? The code which does the work is this:


    CONVERT DATE i_datlo TIME i_timlo
      INTO TIME STAMP e_timestamp TIME ZONE l_tzone.

Maybe you can insert this into your program directly?

Read only

0 Likes
1,432

The problem is :

Eg: Time in user's Zone is 12:00:00

In table its stored as 11:00:00

When fetched back it should show 12:00:00, but its showing 11:00:00

if i use the time conversion before showing, it shows 10:00:00

Read only

0 Likes
1,432

Use time zone if the server and client is not at same time zone.

The statement that i gave worked fine for me and it is a real time code that i am using in one of my program

Read only

0 Likes
1,432

actually i dont hitnk there's a prob with conversion ..

when i change my time zone and see the output .. i get the correct time display ..

but why is the user (with same time zone) not seeing the correct time ? I am checking SU3, should i be checking settings somewhere else ?

Thanks

Read only

0 Likes
1,432

Is the user directly logged into SAP? Did the user try logging off and coming back in again?

Read only

0 Likes
1,432

well , user hasnt changed his time zone , I did. I am already gettign correct time in both the zones.

User is not getting correct time in his zone.

User data is converted before being saved (-1)

When he fetches back , it should be converted again (+1) for correct time dispaly , but conversion makes it (-2) .

Read only

0 Likes
1,432

What is your actual question?

Is that statement/FM not working or problem with displaying the time zone? Please close the thread if you got answer and open up another.

Be clear on what you are asking for?

Read only

0 Likes
1,432

what i meant was for me correct data is displayed without calling any conversion in both the zones , but for the user it isnt.

even when i try to use conversion , it doesnt work .. in the sense that it doesnt display the correct converted values !!

Read only

0 Likes
1,432

Are you both on the same server and executing this the same way(online vs background)?

Read only

0 Likes
1,432

yes , same server . Online.

Thanks

Read only

0 Likes
1,432

Can you tell us which table field it is if standard table and if not, please let us know the data element used for your custom field.

Read only

0 Likes
1,432

What was it?

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,432

>

> What was it?

Generosity in awarding points ... Lolz