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

Timestamp conversion in cds views

Former Member
8,121

How to Convert timestamp data into user time zone like UTC+9:00 in cds views

1 ACCEPTED SOLUTION
Read only

Former Member
6,154

Hi,

Goto Tcode SU01 Enter your username ,

Click on Change icon

Goto Defaults tab

Change your Time Zone Using f4 help option like ( UTC +9:00) format , Please refer the below screen shots.

t1.png

Save the changes

In view try to execute below code

abap_user_timezone( $session.user,$session.client,'FAIL' )

output:-

t3.png

This is your UTC + 9 Time zone output refer screen shot

Goto SU01 tcode

Reset your system previous time zone format.

How to Convert timestamp data into user time zone like UTC+9:00 in cds views

4 REPLIES 4
Read only

Sandra_Rossi
Active Contributor
6,154
Read only

Former Member
6,154

Hi,

Using This syntax : - tstmp_current_utctimestamp() as count_time

After creating view go to SU01 t-code enter your username and go to edit mode and select default tab , change the timezone value UTC+9 select from f4 functionality . save it come back and execute view.

Read only

0 Likes
6,154

Thank you for your replay,

I followed your steps but i didn't got any difference while I'm doing.

This is the result of previously when i executed:

This is the output when i followed your steps:

Read only

Former Member
6,155

Hi,

Goto Tcode SU01 Enter your username ,

Click on Change icon

Goto Defaults tab

Change your Time Zone Using f4 help option like ( UTC +9:00) format , Please refer the below screen shots.

t1.png

Save the changes

In view try to execute below code

abap_user_timezone( $session.user,$session.client,'FAIL' )

output:-

t3.png

This is your UTC + 9 Time zone output refer screen shot

Goto SU01 tcode

Reset your system previous time zone format.