java - Timezone mismatch in SOAP service -


my soap service deployed on server pdt timezone. i'm calling service java (adf) code. service has mandatory parameter takes date-time parameter. here how, i'm calling -

           simpledateformat sdf = new simpledateformat("yyyy-mm-dd hh:mm:ss");            date date = sdf.parse(startdate);            gregoriancalendar c = new gregoriancalendar();            c.settime(date);               sdate = datatypefactory.newinstance().newxmlgregoriancalendar(c);  

the soap service supposed store date-time in database in same server in pdt timezone. if try use service other timezone, converts pdt , store in database.

i want service store same time in database i'm providing, instead of converting it. idea, how ignore timezone.

i suggest storing date times same (implicit) time zone in database. 2 common conventions use local time or zulu time (utc+0). after deciding on convention can store date times without adding timezone information explicitly. (postgress has separate setting this).

as consequence have convert incoming date times database's implicit timezone before storing them. there several patterns this, filters or date time handlers register orm framework.

when returning date times service common convention use zulu time (appending 'z') or utc (appending timezone offset, example '+02:00).

when returning directly user client browser or app option localize date time client. means client has present time zone, example in header field, part of user profile or on login (and stored in http session). component (e.g. controller in mvc application) must apply time zone date time database before adding response.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -