world meaningful date time input

Поиск
Список
Период
Сортировка
Искать

world meaningful date time input

От:
Dennis Gearon <gearond@sbcglobal.net>
Дата:

I've got an application brewing that gathers the following data:
  location (lat/lon)
  time (no time zone)
  date. (no time zone)

The eventual goal is to be able to search chronologically using timestamps for the data anywhere in the world, from any location, using local time as a reference for any future date and time.

From the (lat/lon) it's possible to get:
  named time zone
  standard time zone offset (non dst)
  by some special web services, get dates and amounts of 
    day light savings time

From there, it could possible to combine all the datums and create a timestamp with timezone (i.e. it's stored in absolute time (in seconds) relative to GMT)

Any easier way to do this?


Dennis Gearon

Signature Warning
----------------
EARTH has a Right To Life,
  otherwise we all die.

Read 'Hot, Flat, and Crowded'
Laugh at http://www.yert.com/film.php

Re: world meaningful date time input

От:
Scott Marlowe <scott.marlowe@gmail.com>
Дата:
On Wed, Jun 16, 2010 at 8:25 PM, Dennis Gearon  wrote:
>
> I've got an application brewing that gathers the following data:
>  location (lat/lon)
>  time (no time zone)
>  date. (no time zone)
>
> The eventual goal is to be able to search chronologically using timestamps for the data anywhere in the world, from any location, using local time as a reference for any future date and time.
>
> From the (lat/lon) it's possible to get:
>  named time zone
>  standard time zone offset (non dst)
>  by some special web services, get dates and amounts of
>    day light savings time
>
> From there, it could possible to combine all the datums and create a timestamp with timezone (i.e. it's stored in absolute time (in seconds) relative to GMT)
>
> Any easier way to do this?

Why not set the tz to the one the date / time came from, insert into
timestamptz, then use timestamptz at timezone to retrieve it?

Re: world meaningful date time input

От:
Dennis Gearon <gearond@sbcglobal.net>
Дата:
Thanks Scott

That's basically what I'm planning on doing, and hopefully described. The server will only in 1-10 locations around the world, and I can't use the timezone of the servers anyway, nor the user's input device/browser/phone. The offset/timezone has to be the one for the geographical location of the datum.

But the process you described went one further than I knew, the output in the local tz. Thanks for that.


> Dennis Gearon 
> wrote:
> >
> > I've got an application brewing that gathers the
> following data:
> >  location (lat/lon)
> >  time (no time zone)
> >  date. (no time zone)
> >
> > The eventual goal is to be able to search
> chronologically using timestamps for the data anywhere in
> the world, from any location, using local time as a
> reference for any future date and time.
> >
> > From the (lat/lon) it's possible to get:
> >  named time zone
> >  standard time zone offset (non dst)
> >  by some special web services, get dates and amounts
> of
> >    day light savings time
> >
> > From there, it could possible to combine all the
> datums and create a timestamp with timezone (i.e. it's
> stored in absolute time (in seconds) relative to GMT)
> >
> > Any easier way to do this?
> 
> Why not set the tz to the one the date / time came from,
> insert into
> timestamptz, then use timestamptz at timezone to retrieve
> it?
> 
FAQ