Problem with the use of dates.

Problem with the use of dates.

I'm going to go crazy with ARAS. After several hours using dates, and it didn't work out, I discovered date is stored in the databse in "neutral" date, here in Spain it is +1. That's why the "GET" did not work for me, etc.


Well today, continuing with the work I have realized that depending on whether or not I use "where" I must put the neutral date or with my time zone.

Can you confirm it? It is right?.

// In this, i must to GET the date  - 1 hour (Spain is +1). Neutral Date
CodigoAML = "<Item type='MP Control Descanso' action='get' where=\"[MP_Control_Descanso].mp_fecha_entrada='" + extraeDia(HoraA,1) +"' and [MP_Control_Descanso].mp_con_usr = '"+localizaTrabajador(TrabajadorDNI)+"' and [MP_Control_Descanso].mp_estado = '1'\"></Item>";

// In this, i must to GET the date in my GMT
CodigoAML = "<Item type='MP Control Descanso' action='get'><mp_fecha_entrada>" + extraeDia(HoraA,0) +"</mp_fecha_entrada><mp_con_usr>"+localizaTrabajador(TrabajadorDNI)+"</mp_con_usr><mp_estado>0</mp_estado></Item>";
                


var ResultadoGet = innovator.applyAML("<AML>"+CodigoAML+"</AML>");

Parents
  • Hi,

    it should not be necessary to hard-code the time zone difference. Cause this could lead to trouble with summer/winter time changes.

    I so far didn´t needed "get" queries that required exact hour/minutes filters so I right now don´t know a solution for your scenario. I most of the time just "write" timings. I wonder if and how the regular grid search options consider the time zone difference. 

    I think as the date  is stored in neutral format, you also must use neutral format when searching. So convert your current date to neutral before using it as filter. 

    Have you checked the internationalization guide? It contains a few code samples regarding writing the time in neutral format. 

    www.aras.com/.../aras-innovator-120--configuring-internationalization.ashx

Reply
  • Hi,

    it should not be necessary to hard-code the time zone difference. Cause this could lead to trouble with summer/winter time changes.

    I so far didn´t needed "get" queries that required exact hour/minutes filters so I right now don´t know a solution for your scenario. I most of the time just "write" timings. I wonder if and how the regular grid search options consider the time zone difference. 

    I think as the date  is stored in neutral format, you also must use neutral format when searching. So convert your current date to neutral before using it as filter. 

    Have you checked the internationalization guide? It contains a few code samples regarding writing the time in neutral format. 

    www.aras.com/.../aras-innovator-120--configuring-internationalization.ashx

Children