java - Best strategy to persist ISO8601 -
i have been reading different articles on said question yet unable figure out should best strategy store date in db. i receiving iso8601 date via path-param in rest call. have decided use joda-time parse date. extract utc-0 time out of date , hours offset store utc-0 in datetime datatype in mysql db , store offset in varchar(5) . when have search based on date (an exposed rest api). use search criteria (input date) extract utc-0 time , hours offset , compare 2 columns in db i.e. where table.dateinutc0 = :inputdateinutc0 , table.hoursoffset = :inputhoursoffset i not sure step 4. doing right ? i not sure step 4. doing right ? really, depends on trying do. if want search match if searcher using same timezone original data, doing right. if don't want that, doing wrong. ask this: if enter same date / time in local time zone , utc (or other time zone), mean same thing clients of server? should they?