Timestamp value

Timestamp value

am 06.06.2011 17:10:22 von Jerry Schwartz

When you UPDATE a record, a timestamp field (`t`) is set to the current time
in the time zone given by @@time_zone, correct? That will usually be the local
time.

If somebody in another time zone needs to compare `t` against //their own//
local time, they need to use

CONVERT_TZ(`t`,'my_local_time zone','their_local_time_zone`)

Am I right?

So, what if they do not know my local time zone? Is there a way to create a
timestamp field that is always in UTC? I don't think there is, without using a
trigger.

Am I right about that?



Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341
E-mail: jerry@gii.co.jp
Web site: www.the-infoshop.com






--
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: Timestamp value

am 06.06.2011 18:56:52 von Johan De Meersman

I may be mistaken, but isn't UTC pretty much GMT if you don't want subsecond precision? Set your server's timezone to GMT and you should get what you want.

----- Original Message -----
> From: "Jerry Schwartz"
> To: mysql@lists.mysql.com
> Sent: Monday, 6 June, 2011 5:10:22 PM
> Subject: Timestamp value
>
> When you UPDATE a record, a timestamp field (`t`) is set to the
> current time
> in the time zone given by @@time_zone, correct? That will usually be
> the local
> time.
>
> If somebody in another time zone needs to compare `t` against //their
> own//
> local time, they need to use
>
> CONVERT_TZ(`t`,'my_local_time zone','their_local_time_zone`)
>
> Am I right?
>
> So, what if they do not know my local time zone? Is there a way to
> create a
> timestamp field that is always in UTC? I don't think there is,
> without using a
> trigger.
>
> Am I right about that?
>
>
>
> Regards,
>
> Jerry Schwartz
> Global Information Incorporated
> 195 Farmington Ave.
> Farmington, CT 06032
>
> 860.674.8796 / FAX: 860.674.8341
> E-mail: jerry@gii.co.jp
> Web site: www.the-infoshop.com
>

--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

--
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: Timestamp value

am 06.06.2011 19:03:25 von Jerry Schwartz

>-----Original Message-----
>From: Johan De Meersman [mailto:vegivamp@tuxera.be]
>Sent: Monday, June 06, 2011 12:57 PM
>To: Jerry Schwartz
>Cc: mysql@lists.mysql.com
>Subject: Re: Timestamp value
>
>
>I may be mistaken, but isn't UTC pretty much GMT if you don't want subsecond
>precision? Set your server's timezone to GMT and you should get what you
>want.

[JS] I don't want to affect everything on the server (scheduled events, file
modification dates, etc.) I only want one UTC (or GMT, I don't really care)
field.

Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341
E-mail: jerry@gii.co.jp
Web site: www.the-infoshop.com







--
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