0

my course timezone is MST .I Have submitted assignment of course in 11:30 pm of 12/9/2014(MST).But am storing standard timezone in db as US/EASTERN.The differene between MST and US/EASTERN is 3 hrs.so it is storing in 13/9/2014.when i trying to get data on 12/09/14 (12:00:00 Am)according to my system date(IST)...will be converted into MST and then US/EASTERN.I am not getting the data....if i choose 13/9/14 then am getting data.

I am using this sql query

<#if selectedDate??>AND sas.SUBMITTED_DATE < (TO_DATE('${toDate?string("dd-MMM-yyyy")}', 'DD-MON-YYYY') + 1) </#if>

If i changed to like this, working fine..but will fail in some other scenario

<#if selectedDate??>AND sas.SUBMITTED_DATE < (TO_DATE('${selectedDate?string("dd-MMM-yyyy")}', 'DD-MON-YYYY') + 2) </#if>...

need to work in all scenarios

VivienG
  • 2,143
  • 3
  • 24
  • 43
  • 1
    You need to store your data in UTC, then render it with the timezone required. – Burhan Khalid Oct 17 '14 at 13:19
  • no.... need to store data in US/EASTERN ONLY....according to my course timezone ..need to get data – user3318237 Oct 17 '14 at 13:26
  • @user3318237 No, you *really* need to adjust your date-time values to UTC when storing, or have the database do it for you, as Burhan Khalid suggests. Please search StackOverflow to study. Start [here](http://stackoverflow.com/q/2532729/642706). – Basil Bourque Oct 17 '14 at 16:47
  • Also, when asking a database question, you must provide us with the *exact* data type of the column, what database, and the means of communication between your app and the database (JDBC?), if you want the most helpful answers. – Basil Bourque Oct 17 '14 at 16:51

0 Answers0