how to get the timestamp from remote mysql
am 04.07.2009 08:48:43 von Nathan Huang
Hi guys
I am going to fetch out the data from remote mysql database according to
timestamps colmmen, however my local date is different from the one on
remote mysql database,
how can I get right timestamp using the date of remote time zone? that
is to say I set the date and send itto remote server or database to
calculate timestamps of it
thanks in advance
nathan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: how to get the timestamp from remote mysql
am 04.07.2009 10:27:26 von Marcus Bointon
On 4 Jul 2009, at 07:48, Nathan Huang wrote:
> I am going to fetch out the data from remote mysql database
> according to timestamps colmmen, however my local date is different
> from the one on remote mysql database,
> how can I get right timestamp using the date of remote time zone?
> that is to say I set the date and send itto remote server or
> database to calculate timestamps of it
> thanks in advance
There is one straightforward solution: only ever keep timestamps in
UTC/GMT and correct for time zone / DST when you display them. While
that can be confusing sometimes, overall it's a much simpler way of
working that storing local times.
Marcus
--
Marcus Bointon
Synchromedia Limited: Creators of http://www.smartmessages.net/
UK resellers of info@hand CRM solutions
marcus@synchromedia.co.uk | http://www.synchromedia.co.uk/
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: how to get the timestamp from remote mysql
am 04.07.2009 16:26:33 von Michael Dykman
Assuming that synchornizing the clocks between the systems is beyond
your control you could try getting the UTC timestamp from both
systems, then adjust your date/time math according to the difference
between them.
> select unix_timestamp(utc_timestamp());
It is more than a little hacky, but it will work
- michael dykman
On Sat, Jul 4, 2009 at 2:48 AM, Nathan
Huang wrote:
> Hi guys
> I am going to fetch out the data from remote mysql database according to
> timestamps colmmen, however my local date is different from the one on
> remote mysql database,
> how can I get right timestamp using the date of remote time zone? that is to
> say I set the date and send itto remote server or database to calculate
> timestamps of it
> thanks in advance
> nathan
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=mdykman@gmail.com
>
>
--
- michael dykman
- mdykman@gmail.com
- All models are wrong. Some models are useful.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org