Smarts version 9.2.4 is being used here and I am using this logic actually to restrict email adapter to send emails based of specific time value (say only between 9:00 am to 06:00 pm). I used other logics in the ASL script by using different classes and their values and it working fine but some how time values and their comparison is not working.
following is the ASL script which i am using for test with sm_adapter.
START { } do {
//comparing June 30, 2017 12:15:28 PM GMT+05:00 +344ms with 09:00 am
if (time() > time(1498813200)) {
print(time()." Is Greater than ".time(1498813200));
Thanks for your solution its working perfectly, can you help me to make it more better as I want to compare value of current time in numeric with the value of some specific time value of same day. I mean its actually a mail adapter which I am customizing to stop email sending if time is more than 18:00 hours of the same day when mail is being sent.
In a nutshell is there any way to convert say [ July 18, 2017 4:00:00 AM GMT+05:00] to numeric in order to compare it with the numeric value current time stamp (numeric(time())).
prashanthveerap
3 Posts
2756
0
Posted July 4th, 2017 02:00
START {
.. eol
}
do {
p = time();
r = numeric(p);
q = time(1496061600);
//print(p);
//print(q);
//print("the numeric time for Today is ".r);
if (r > q){
print(r."value is greater than".q);
}
}
output:
1499161207value is greater than1496061600