2008 Jul 15 7:08 AM
How can we compare two time stamps ???
I tried using GE operator but it is not comparing it correctly. It is comparing it in numerical manner.
Please give the appropriate solution .
2008 Jul 15 7:28 AM
Hi,
Use the COMPARE method in the class CL_ABAP_TSTMP which is the optimal way.
CALL METHOD cl_abap_tstmp=>compare
EXPORTING
tstmp1 = timestamp1
tstmp2 = timestamp2
receiving
comp = result. " Result: Smaller (-1), Equal (0), Greater (1)
Cheers
Kothand
Hi Shreya,
Check out this link, which have comparision an also conversion of timestamps:
http://www.sapnet.ru/abap_docu/ABENTIME-STAMP-GENERAL.htm
Hope this helps you.
Regards,
Chandra Sekhar
2008 Jul 15 7:23 AM
Hi,
TIMESTAMP is stored in the database in the UTC time zone. Time stamp values in the database are therefore independent of the time zone of the application that generated the value, and independent of the database instance. This means that you can compare time stamp values across different time zones.
TIMESTAMP data is represented as an object by using the class java.sql.Timestamp.
For further details,
check the source link [http://help.sap.com/saphelp_webas630/helpdata/en/6c/7784ac804be2419f957e8434be6a07/content.htm]
regards,
anirban
2008 Jul 15 7:26 AM
Hi Shreya,
Check out this link, which have comparision an also conversion of timestamps:
http://www.sapnet.ru/abap_docu/ABENTIME-STAMP-GENERAL.htm
Hope this helps you.
Regards,
Chandra Sekhar
2008 Jul 15 7:28 AM
Hi,
Use the COMPARE method in the class CL_ABAP_TSTMP which is the optimal way.
CALL METHOD cl_abap_tstmp=>compare
EXPORTING
tstmp1 = timestamp1
tstmp2 = timestamp2
receiving
comp = result. " Result: Smaller (-1), Equal (0), Greater (1)
Cheers
Kothand
2008 Jul 15 7:28 AM
Use the COMPARE method of the class:
CL_ABAP_TSTMP.
TRY.
CALL METHOD cl_abap_tstmp=>compare
EXPORTING
tstmp1 =
tstmp2 =
receiving
comp =
.
CATCH cx_parameter_invalid_type .
CATCH cx_parameter_invalid_range .
ENDTRY.
Regards
Kannaiah
2008 Jul 15 7:29 AM
hi,
You can use CL_ABAP_TSTMP Class for the purpose.
Plz Refer to this link.
Regards
Sumit Agarwal
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |