Skip to Content
author's profile photo Former Member
Former Member

Problem in timestamp

Hi Experts,

There was a problem in my time stamp.

In my web dynpro compinent i am using timestamp feature for comments.

for every comment i posted in a table i am also adding times stamp with this comment but when i see this time stamp in the table its giving wrong time

Following is the statement

CONVERT DATE sy-datum TIME sy-uzeit INTO TIME STAMP ls_comments-timestamp TIME ZONE sy-zonlo.

time zone sy-zonlo is EST. Time is showing almost 5 hours forward

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 20, 2012 at 11:33 AM

    That's the way timestamp works. You have local time zone set as EST, the timestamp calculation is then based upon UTC - local time zone, for which I typically have a five hour difference. Try creating your time zone with time zone set to space in a variable. I did that, as I recall, to force local time into the table in one of my programs.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 20, 2012 at 08:58 AM

    Hi,

    I dont think you need to concatenate to get the timestamp.You can directly write like below:

    get time stamp field v_timestamp.

    For help you can refer to the below link:

    http://help.sap.com/abapdocu_70/en/ABAPGET_TIME-STAMP.htm

    Hope it solves your problem.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 20, 2012 at 09:00 AM

    In the table it must be storing the timestamp as per the system time-zone. Check your Time-Zone and System timzone.. I believe you will get the difference between these two time zone as 5 hours 😉

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.