Openshift does not react on INTERVAL of MySQL -


i have tested table test on locanhost , openshift , facing problem on openshift not getting when query data where arrivaltime between curtime() - interval 2 minute , curtime() + interval 2 minute although on localhost getting route 9 back. on openshift insert arrivaltime according server time. on localhost inserting arrivaltime according local time when change query form where time_format(arrivaltime,'%h:%i')= time_format(curtime() ,'%h:%i') getting 9back on openshift need response be+- 2 minutes. how can fix it? or have openshift account how can test table , query below?

i appreciate help.

test table

create table test( id int(11) not null auto_increment primary key,  arrivaltime time  not null,  route int(11) not null    ) 

inserting data:

insert test(arrivaltime, route) values('04:16:00', 9) 

this query not work on openshift , works on localhost:

select route test arrivaltime between curtime() - interval 2 minute , curtime() + interval 2 minute 

openshift curtime()

04:15:15 

when query test on openshift getting response arrivaltime should equal current time.

select route test time_format(arrivaltime,'%h:%i')= time_format(curtime() ,'%h:%i') 

well, i'm not @ mysql. so, maybe improve question here. guess problem lies in server local time format or maybe how mysql return time format after add or subtract time.

for problem, i'll advise use query instead of trying modify directly that.

select route test arrivaltime between subtime(curtime(), '00:02:00') , addtime(curtime(), '00:02:00'); 

and make sure problem is, maybe try check whether there warning or error using query.

show warnings; show errors; 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -