Former Member

# time comparison.

Hai,

I want to check whether Current time

is between 16:00 and 21:00

do we have any Function?

Regards

Chandra kumar.

10|10000 characters needed characters exceeded

### Related questions

Former Member
Posted on Jan 12, 2005 at 06:59 AM

Hi dear chandra kumar,

One can use this logic :

*----

report abc.

data : t1 type sy-uzeit,

t2 type sy-uzeit.

t1 = '1600'.

t2 = '2100'.

write :/ sy-uzeit.

if sy-uzeit >= t1 and sy-uzeit <= t2.

write : 'current time is in between ' , t1 , 'and' , t2.

else.

write : 'current time is NOT in between ' , t1 , 'and' , t2.

endif.

*----

I have opened my account in sdn for the first

time today and this is my first reply to you.

I Hope your purpose is solved.

Please give point if u feel satisfied.

Thanks & Regards,

Amit Mittal.

10|10000 characters needed characters exceeded
• Former Member

Hello Amit,

It's nice to know that we have a new member here at SDN. A hearty welcome to you. Hope to have a lot of discussions where we could share some interesting stuff.

Regards,

Anand Mandalika.

• Posted on Jan 12, 2005 at 07:02 AM

Hi ,Chandrea,

If sy-uzeit between '16:00' and '21:00'.

...

Andreas

10|10000 characters needed characters exceeded
• Former Member
Posted on Jan 12, 2005 at 07:26 AM

Hello Chandra,

There's a small point that I would like to make. Though it is a good idea to use the exisitng Function Modules to meet our requirements, it is not very wise to always spend much time in searching for a Function Module in cases as simple as this one.

There are several ways in which you can check for the condition you want- The following is one of them...

```if sy-uzeit between '080000' and '210000'.
* Do the processing.
endif.
```

Regards,

Anand Mandalika.

10|10000 characters needed characters exceeded
• Former Member Former Member

You will probably get more response if you open your own thread.

Before you start, you have to know the date of all three times..

Rob