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

  1. use joda-time parse date.
  2. extract utc-0 time out of date , hours offset
  3. store utc-0 in datetime datatype in mysql db , store offset in varchar(5).
  4. 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?


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -