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

Getting Date and Time

Former Member
0 Likes
507

Hi Gurus,

Issue: At present the Shipment Execution time is defaulting to Local Time but the requirement is to always populate Eastern Standard Time (EST). Right now if the shipment creates in US West coast, shipment Execution Date and Time populates with that local time but I need to populate EST.

I need a function module which will take input as 'Time Zone' like EST and return Date and Time (OR) the input could be 'Country' and State and return the local time.

Thanks in Advance.

Regards,

ananth.

2 REPLIES 2
Read only

Former Member
0 Likes
460

Check this FM if of any help

TZ_LOCATION_TIMEZONE

[http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CAGTFTIM/CAGTFTIM.pdf]

[http://abaplog.wordpress.com/2007/02/19/handling-date-and-time-on-sap-systems-running-across-multiple-time-zones/]

Read only

0 Likes
460

Here is your solution.

The function module IB_CONVERT_INTO_TIMESTAMP is used to convert the time to the GMT. The input parameters are DATE, TIME and the TIMEZONE(user's time zone, default value SY-ZONLO). The output parameter is the timestamp in GMT.

The function module IB_CONVERT_FROM_TIMESTAMP is used to get the time in required time zone. The input parameters for this are the timestamp obtained from the above function module and the time zone, to which the time needs to be converted.

The output parameters are the date, time in the required time zone.