B
Big Jim
apologies, not really a java query, but a follow on from my last post which
was specifically java.
From the last post I get the impression that the standard method of storing
dates (in this case a "next_call_date" as part of a deal object) is:
user in Japan enters 06/06/06
this gets converted to millis from epoch, let's say it equals 90, sends 90
to server
server saves 90 in DB (or converts 90 to a date in a consistent timezone,
lets say GMT gives 05/06/06 and stores that)
client requests said date
server (possibly converts the DB date to a long and) sends 90 to client
client converts 90 to local date and displays 06/06/06
So, I'm wondering what's the standard solution for querying the DB:
another client in NY enters 06/06/06
this gets converted to millis from epoch which this time gives us say 150
server saves 150 (or 06/06/06) in the DB
So, 2 questions,
1. some support analyst in the UK wants to get all the dates with a
start_date of 06/06/06, he enters
select * from deal where next_call_date = 06/06/06 which obviously won't
find the japan deal
2. the clients have a "search for deal where next_call_date is, is before or
is after" facility, how would they do this? e.g. in Japan the user enters:
get deals where next_call_date is 06/06/06 - if it then sends 90 to the
server how can the server know to return the deal entered in NY?
Is there a tried and trusted way to deal with these situations?
Cheers for any advice, Richard.
was specifically java.
From the last post I get the impression that the standard method of storing
dates (in this case a "next_call_date" as part of a deal object) is:
user in Japan enters 06/06/06
this gets converted to millis from epoch, let's say it equals 90, sends 90
to server
server saves 90 in DB (or converts 90 to a date in a consistent timezone,
lets say GMT gives 05/06/06 and stores that)
client requests said date
server (possibly converts the DB date to a long and) sends 90 to client
client converts 90 to local date and displays 06/06/06
So, I'm wondering what's the standard solution for querying the DB:
another client in NY enters 06/06/06
this gets converted to millis from epoch which this time gives us say 150
server saves 150 (or 06/06/06) in the DB
So, 2 questions,
1. some support analyst in the UK wants to get all the dates with a
start_date of 06/06/06, he enters
select * from deal where next_call_date = 06/06/06 which obviously won't
find the japan deal
2. the clients have a "search for deal where next_call_date is, is before or
is after" facility, how would they do this? e.g. in Japan the user enters:
get deals where next_call_date is 06/06/06 - if it then sends 90 to the
server how can the server know to return the deal entered in NY?
Is there a tried and trusted way to deal with these situations?
Cheers for any advice, Richard.