TimeZone

Hi,
There is a request from mgmt, when user browse the request (web), the
database will return the requested timestamp at their timezone that
previously posted. How do i do that? Do I need store whole country codes
together timezones in database mysql ? Is there any way to find full
country code together with their timezone?


Cheers
KH


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql [at] m.gmane.org
KH [ Mo, 08 August 2005 12:05 ] [ ID #912894 ]

Re: TimeZone

Some countries have multiple timezones, so it is not sufficient to
know the country code in order to get the timezone. If they have
previously posted the timezone, however, then it should be possible to
store that information in a cookie on the client machine that your web
layer can retrieve. If you want to permanently tie a timezone to a
user (assuming that this is an internal system or other system to
which your users authenticate -- if it is a public website you're
going to have to use cookies), simply include an extra column in the
user's record that has a number that stores its differential from GMT
(so the USA east coast would be -5) and save all of your data in GMT,
applying the timezone column to the time via datetime functions either
in the query or in your web layer.

-- Joe

On 8/8/05, KH <khenghuatlim [at] time.net.my> wrote:
> Hi,
> There is a request from mgmt, when user browse the request (web), the
> database will return the requested timestamp at their timezone that
> previously posted. How do i do that? Do I need store whole country codes
> together timezones in database mysql ? Is there any way to find full
> country code together with their timezone?
>
>
> Cheers
> KH
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dg.jsciv [at] gmail.com
>
>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql [at] m.gmane.org
Joseph Cochran [ Di, 09 August 2005 01:39 ] [ ID #914852 ]

Re: TimeZone

Joseph Cochran wrote:
> Some countries have multiple timezones, so it is not sufficient to
> know the country code in order to get the timezone. If they have
> previously posted the timezone, however, then it should be possible to
> store that information in a cookie on the client machine that your web
> layer can retrieve. If you want to permanently tie a timezone to a
> user (assuming that this is an internal system or other system to
> which your users authenticate -- if it is a public website you're
> going to have to use cookies), simply include an extra column in the
> user's record that has a number that stores its differential from GMT
> (so the USA east coast would be -5) and save all of your data in GMT,
> applying the timezone column to the time via datetime functions either
> in the query or in your web layer.

One more complication: daylight savings time are not the same world
wide. So I would store the time zone and not the difference with GMT.

I personally would do al the time zone calculations in the web layer.
Most OSs have libraries with more or less knowledge about daylight
savings in various countries/timezones. Using the functions in the
language of the web layer you're more likely to get things right.

Regards, Jigal.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql [at] m.gmane.org
Jigal van Hemert [ Di, 09 August 2005 08:47 ] [ ID #914860 ]

Re: timezone

--0016368342d1f7964004a4cb3926
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

Have you populated the timezone tables? Run this query if you are not sure.

*SELECT COUNT(*) FROM mysql.time_zone_name;*
*
*
***If it returns 0 then you need to populate the them as per the
instructions here
http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.htm l*

Default timezone in mysql is set at server startup to SYSTEM, which means s=
o
long as your system clock is correct the MySQL server should be correct.


*
*
On 3 June 2011 09:55, Rocio Gomez Escribano
<r.gomez [at] ingenia-soluciones.com>wrote:

> Hello! I=92m having trouble with timezones.
>
>
>
> I=92m in Spain, we have 2 different timezone now we are in GMT+2, in wint=
er,
> this is the GMT+1.
>
>
>
> I=92m looking for an instruction which give me the current timezone, but =
I
> cant find it! Do you know how can I now it?
>
>
>
> Thanks!
>
>
>
> *Roc=EDo G=F3mez Escribano*
>
> r.gomez [at] ingenia-soluciones.com <r.sanchez [at] ingenia-soluciones.com>
>
>
>
> [image: Descripci=F3n: cid:image002.jpg [at] 01CB8CB6.ADEBA830]
>
> Pol=EDgono Campollano C/F, n=BA21T
>
> 02007 Albacete (Espa=F1a)
>
> Tlf:967-504-513 Fax: 967-504-513
>
> www.ingenia-soluciones.com
>
>
>



--
John Daisley

Certified MySQL 5 Database Administrator
Certified MySQL 5 Developer
Cognos BI Developer

Telephone: +44 (0)7918 621621
Email: john.daisley [at] butterflysystems.co.uk

--0016368342d1f7964004a4cb3926--
John Daisley [ Fr, 03 Juni 2011 11:17 ] [ ID #2060449 ]

RE: timezone

------=_NextPart_000_0021_01CC21E1.47AD7510
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0022_01CC21E1.47AD7510"


------=_NextPart_001_0022_01CC21E1.47AD7510
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I=92m afraid I don=92=92t understand you:





mysql> select count(*) from mysql.time_zone_name;

+----------+

| count(*) |

+----------+

| 0 |

+----------+

1 row in set (0.00 sec)



But, when I execute:





mysql> select now();

+---------------------+

| now() |

+---------------------+

| 2011-06-03 11:28:00 |

+---------------------+

1 row in set (0.00 sec)



That=92s correct, in Spain it=92s that time. So, mysql is using the =
timezone
correctly, isn=92t it?



Thanks!



Roc=EDo G=F3mez Escribano

<mailto:r.sanchez [at] ingenia-soluciones.com> =
r.gomez [at] ingenia-soluciones.com



Descripci=F3n: cid:image002.jpg [at] 01CB8CB6.ADEBA830

Pol=EDgono Campollano C/F, n=BA21T

02007 Albacete (Espa=F1a)

Tlf:967-504-513 Fax: 967-504-513

www.ingenia-soluciones.com



De: John Daisley [mailto:daisleyjohn [at] googlemail.com]
Enviado el: viernes, 03 de junio de 2011 11:18
Para: Rocio Gomez Escribano
CC: mysql [at] lists.mysql.com
Asunto: Re: timezone



Have you populated the timezone tables? Run this query if you are not =
sure.



SELECT COUNT(*) FROM mysql.time_zone_name;



If it returns 0 then you need to populate the them as per the =
instructions
here http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.htm l



Default timezone in mysql is set at server startup to SYSTEM, which =
means so
long as your system clock is correct the MySQL server should be correct.







On 3 June 2011 09:55, Rocio Gomez Escribano =
<r.gomez [at] ingenia-soluciones.com>
wrote:

Hello! I=92m having trouble with timezones.



I=92m in Spain, we have 2 different timezone now we are in GMT+2, in =
winter,
this is the GMT+1.



I=92m looking for an instruction which give me the current timezone, but =
I
cant find it! Do you know how can I now it?



Thanks!



Roc=EDo G=F3mez Escribano

r.gomez [at] ingenia-soluciones.com <mailto:r.sanchez [at] ingenia-soluciones.com> =




=A1Error! Nombre de archivo no especificado.

Pol=EDgono Campollano C/F, n=BA21T

02007 Albacete (Espa=F1a)

Tlf:967-504-513 Fax: 967-504-513

<http://www.ingenia-soluciones.com> www.ingenia-soluciones.com






--
John Daisley

Certified MySQL 5 Database Administrator
Certified MySQL 5 Developer
Cognos BI Developer

Telephone: +44 (0)7918 621621
Email: john.daisley [at] butterflysystems.co.uk


------=_NextPart_001_0022_01CC21E1.47AD7510
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta name=3DGenerator =
content=3D"Microsoft Word 12 (filtered medium)"><!--[if =
!mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
..shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
[at] font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
[at] font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
[at] font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Texto de globo Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EstiloCorreo19
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.TextodegloboCar
{mso-style-name:"Texto de globo Car";
mso-style-priority:99;
mso-style-link:"Texto de globo";
font-family:"Tahoma","sans-serif";}
..MsoChpDefault
{mso-style-type:export-only;}
[at] page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"2050" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DES link=3Dblue =
vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal><a =
name=3D"_MailEndCompose"><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>I’m afraid I don’’t understand =
you:<o:p></o:p></span></a></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>mysql> select count(*) from =
mysql.time_zone_name;<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>+----------+<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>| count(*) |<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>+----------+<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>|=A0=A0=A0=A0=A0=A0=A0 0 |<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>+----------+<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>1 row in set (0.00 sec)<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>But, when I execute:<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>mysql> select now();<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>+---------------------+<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>| now()=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
|<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>+---------------------+<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>| 2011-06-03 11:28:00 |<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>+---------------------+<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>1 row in set (0.00 sec)<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>That’s correct, in Spain it’s that time. So, mysql is =
using the timezone correctly, isn’t it?<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'>Thanks!<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'><o:p> </o:p></span></p><p class=3DMsoNormal><b><span =
lang=3DES-PE =
style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" ;color:#0070C=
0'>Roc=EDo G=F3mez Escribano<o:p></o:p></span></b></p><p =
class=3DMsoNormal><a =
href=3D"mailto:r.sanchez [at] ingenia-soluciones.com"><span lang=3DES-PE =
style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" '>r.gomez [at] ing=
enia-soluciones.com</span></a><span lang=3DES-PE =
style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" ;color:#9D9D9=
D'><o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:blue'>=
<o:p> </o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:9.0pt;font-family:"Calibri","sans-serif"; color:#9D9D9D=
'><img border=3D0 width=3D181 height=3D74 id=3D"Imagen_x0020_1" =
src=3D"cid:image001.jpg [at] 01CC21E1.46848570" alt=3D"Descripci=F3n: =
cid:image002.jpg [at] 01CB8CB6.ADEBA830"></span><span =
style=3D'font-family:"Calibri","sans-serif";color:blue'><o:p></o:p></span=
></p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" ;color:#A6A6A=
6'>Pol=EDgono Campollano C/F, n=BA21T</span><span =
style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" ;color:blue'>=
<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" ;color:#9D9D9=
D'>02007 Albacete (Espa=F1a)<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" ;color:#9D9D9=
D'>Tlf:967-504-513  Fax: 967-504-513<o:p></o:p></span></p><p =
class=3DMsoNormal><a href=3D"www.ingenia-soluciones.com" =
title=3D"blocked::www.ingenia-soluciones.com"><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" ;color:#9D9D9=
D'>www.ingenia-soluciones.com</span></a><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" ;color:#A6A6A=
6'><o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497=
D'><o:p> </o:p></span></p><div =
style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm =
0cm 0cm'><p class=3DMsoNormal><b><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' >De:</span></=
b><span style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'> =
John Daisley [mailto:daisleyjohn [at] googlemail.com] <br><b>Enviado el:</b> =
viernes, 03 de junio de 2011 11:18<br><b>Para:</b> Rocio Gomez =
Escribano<br><b>CC:</b> mysql [at] lists.mysql.com<br><b>Asunto:</b> Re: =
timezone<o:p></o:p></span></p></div><p =
class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>Have you =
populated the timezone tables? Run this query if you are not =
sure.<o:p></o:p></p><div><p =
class=3DMsoNormal><o:p> </o:p></p></div><div><p =
class=3DMsoNormal><code><b><span style=3D'font-size:10.0pt'>SELECT =
COUNT(*) FROM =
mysql.time_zone_name;</span></b></code><o:p></o:p></p></div><div><p =
class=3DMsoNormal><o:p> </o:p></p></div><div><p =
class=3DMsoNormal><b><span style=3D'font-family:"Courier New"'>If it =
returns 0 then you need to populate the them as per the instructions =
here <a =
href=3D"http://dev.mysql.com/doc/refman/5.5/en/time-zone-sup port.html">ht=
tp://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html</a></span></b=
><o:p></o:p></p></div><div><p =
class=3DMsoNormal><o:p> </o:p></p></div><div><p =
class=3DMsoNormal>Default timezone in mysql is set at server startup to =
SYSTEM, which means so long as your system clock is correct the MySQL =
server should be correct.<o:p></o:p></p></div><div><p =
class=3DMsoNormal><o:p> </o:p></p></div><div><p =
class=3DMsoNormal><o:p> </o:p></p></div><div><p class=3DMsoNormal =
style=3D'margin-bottom:12.0pt'><o:p> </o:p></p><div><p =
class=3DMsoNormal>On 3 June 2011 09:55, Rocio Gomez Escribano <<a =
href=3D"mailto:r.gomez [at] ingenia-soluciones.com">r.gomez [at] ingen ia-soluciones=
..com</a>> wrote:<o:p></o:p></p><div><div><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><span =
lang=3DEN-US>Hello! I’m having trouble with =
timezones.</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><span =
lang=3DEN-US> </span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><span =
lang=3DEN-US>I’m in Spain, we have 2 different timezone now we are =
in GMT+2, in winter, this is the GMT+1.</span><o:p></o:p></p><p =
class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><span =
lang=3DEN-US> </span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><span =
lang=3DEN-US>I’m looking for an instruction which give me the =
current timezone, but I cant find it! Do you know how can I now =
it?</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><span =
lang=3DEN-US> </span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><span =
lang=3DEN-US>Thanks!</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><span =
lang=3DEN-US> </span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><b><span =
lang=3DES-PE style=3D'font-size:10.0pt;color:#0070C0'>Roc=EDo G=F3mez =
Escribano</span></b><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><span =
lang=3DES-PE style=3D'font-size:10.0pt;color:#9D9D9D'><a =
href=3D"mailto:r.sanchez [at] ingenia-soluciones.com" =
target=3D"_blank">r.gomez [at] ingenia-soluciones.com</a></span><o:p></o:p></p=
><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><span =
style=3D'color:blue'> </span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><span =
style=3D'font-size:9.0pt;color:#9D9D9D'><b>=A1Error! Nombre de archivo =
no especificado.</b></span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><span =
style=3D'font-size:10.0pt;color:#A6A6A6'>Pol=EDgono Campollano C/F, =
n=BA21T</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><span =
style=3D'font-size:10.0pt;color:#9D9D9D'>02007 Albacete =
(Espa=F1a)</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><span =
lang=3DEN-GB =
style=3D'font-size:10.0pt;color:#9D9D9D'>Tlf:967-504-513  Fax: =
967-504-513</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><span =
style=3D'font-size:10.0pt;color:#A6A6A6'><a =
href=3D"http://www.ingenia-soluciones.com" target=3D"_blank" =
title=3D"blocked::www.ingenia-soluciones.com"><span lang=3DEN-GB =
style=3D'color:#9D9D9D'>www.ingenia-soluciones.com</span></a></span><o:p>=
</o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><span =
lang=3DEN-US> </span><o:p></o:p></p></div></div></div><p =
class=3DMsoNormal><br><br clear=3Dall><br>-- <br>John =
Daisley<br><br>Certified MySQL 5 Database Administrator<br>Certified =
MySQL 5 Developer<br>Cognos BI Developer<br><br>Telephone: +44 (0)7918 =
621621<br>Email: <a =
href=3D"mailto:john.daisley [at] butterflysystems.co.uk">john.dai sley [at] butterfl=
ysystems.co.uk</a><o:p></o:p></p></div></div></body></html>
------=_NextPart_001_0022_01CC21E1.47AD7510--

------=_NextPart_000_0021_01CC21E1.47AD7510--
Rocio Gomez Escribano [ Fr, 03 Juni 2011 11:27 ] [ ID #2060450 ]

Re: timezone

--00163683415ebee6fa04a4cbef1e
Content-Type: multipart/alternative; boundary=00163683415ebee6de04a4cbef1d

--00163683415ebee6de04a4cbef1d
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

now() returns the current system time which doesn't really have a great dea=
l
to do with time zones.

You can check what the current time zone is set to with the following
command

*show variables like 'time_zone';*

but that is likely to return the value '*SYSTEM*' which means it takes the
value from the host operating system ( usually set in /etc/timezone ).

You can set the time_zone variable either globally or per session to an
offset of UTC as follows

*SET time_zone=3D'+00:00:00';*
*SET GLOBAL time_zone=3D'+00:00:00';*

Or you can specify a '*default_time_zone*' in your my.cnf/my.ini options
file.

You can also set the time_zone variables to a named offset which will then
take account of daylight savings times but to do this you must first load
the mysql time zone tables.

I strongly suggest you read the manual section relating to time zone suppor=
t
which you can find here

http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.htm l



On 3 June 2011 10:27, Rocio Gomez Escribano
<r.gomez [at] ingenia-soluciones.com>wrote:

> I=92m afraid I don=92=92t understand you:
>
>
>
>
>
> mysql> select count(*) from mysql.time_zone_name;
>
> +----------+
>
> | count(*) |
>
> +----------+
>
> | 0 |
>
> +----------+
>
> 1 row in set (0.00 sec)
>
>
>
> But, when I execute:
>
>
>
>
>
> mysql> select now();
>
> +---------------------+
>
> | now() |
>
> +---------------------+
>
> | 2011-06-03 11:28:00 |
>
> +---------------------+
>
> 1 row in set (0.00 sec)
>
>
>
> That=92s correct, in Spain it=92s that time. So, mysql is using the timez=
one
> correctly, isn=92t it?
>
>
>
> Thanks!
>
>
>
> *Roc=EDo G=F3mez Escribano*
>
> r.gomez [at] ingenia-soluciones.com <r.sanchez [at] ingenia-soluciones.com>
>
>
>
> [image: Descripci=F3n: cid:image002.jpg [at] 01CB8CB6.ADEBA830]
>
> Pol=EDgono Campollano C/F, n=BA21T
>
> 02007 Albacete (Espa=F1a)
>
> Tlf:967-504-513 Fax: 967-504-513
>
> www.ingenia-soluciones.com
>
>
>
> *De:* John Daisley [mailto:daisleyjohn [at] googlemail.com]
> *Enviado el:* viernes, 03 de junio de 2011 11:18
> *Para:* Rocio Gomez Escribano
> *CC:* mysql [at] lists.mysql.com
> *Asunto:* Re: timezone
>
>
>
> Have you populated the timezone tables? Run this query if you are not sur=
e.
>
>
>
> *SELECT COUNT(*) FROM mysql.time_zone_name;*
>
>
>
> *If it returns 0 then you need to populate the them as per the
> instructions here
> http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.htm l*
>
>
>
> Default timezone in mysql is set at server startup to SYSTEM, which means
> so long as your system clock is correct the MySQL server should be correc=
t.
>
>
>
>
>
>
>
> On 3 June 2011 09:55, Rocio Gomez Escribano <
> r.gomez [at] ingenia-soluciones.com> wrote:
>
> Hello! I=92m having trouble with timezones.
>
>
>
> I=92m in Spain, we have 2 different timezone now we are in GMT+2, in wint=
er,
> this is the GMT+1.
>
>
>
> I=92m looking for an instruction which give me the current timezone, but =
I
> cant find it! Do you know how can I now it?
>
>
>
> Thanks!
>
>
>
> *Roc=EDo G=F3mez Escribano*
>
> r.gomez [at] ingenia-soluciones.com <r.sanchez [at] ingenia-soluciones.com>
>
>
>
> *=A1Error! Nombre de archivo no especificado.*
>
> Pol=EDgono Campollano C/F, n=BA21T
>
> 02007 Albacete (Espa=F1a)
>
> Tlf:967-504-513 Fax: 967-504-513
>
> www.ingenia-soluciones.com
>
>
>
>
>
>
> --
> John Daisley
>
> Certified MySQL 5 Database Administrator
> Certified MySQL 5 Developer
> Cognos BI Developer
>
> Telephone: +44 (0)7918 621621
> Email: john.daisley [at] butterflysystems.co.uk
>



--
John Daisley
Butterfly Information Systems

Microsoft SQL Server Database Administrator
Certified MySQL 5 Database Administrator & Developer
Cognos BI Developer \ Administrator

Available for short & long term contracts

Telephone: +44 (0)7918 621621
Email: john.daisley [at] butterflysystems.co.uk

--00163683415ebee6de04a4cbef1d
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

now() returns the current system time which doesn't really have a great=
deal to do with time zones.<div><br></div><div>You can check what the curr=
ent time zone is set to with the following command<div><br></div><div><i>sh=
ow variables like 'time_zone';</i><br>
<div><br></div><div>but that is likely to return the value '<i>SYSTEM</=
i>' which means it takes the value from the host operating system ( usu=
ally set in /etc/timezone ).=A0</div><div><br></div><div>You can set the ti=
me_zone variable either globally or per session to an offset of UTC as foll=
ows</div>
<div><br></div><div><i>SET time_zone=3D'+00:00:00';</i></div><div><=
i>SET GLOBAL time_zone=3D'+00:00:00';</i></div><div><br></div><div>=
Or you can specify a '<i>default_time_zone</i>' in your my.cnf/my.i=
ni options file.</div>
<div><br></div><div>You can also set the time_zone variables to a named off=
set which will then take account of daylight savings times but to do this y=
ou must first load the mysql time zone tables.=A0</div><div><br></div><div>
I strongly suggest you read the manual section relating to time zone suppor=
t which you can find here=A0</div><div><br></div><div><a href=3D"http://dev=
..mysql.com/doc/refman/5.5/en/time-zone-support.html">http:/ /dev.mysql.com/d=
oc/refman/5.5/en/time-zone-support.html</a><br>
</div><div><br></div><div><br></div><div><br></div><div><div class=3D"gmail=
_quote">On 3 June 2011 10:27, Rocio Gomez Escribano <span dir=3D"ltr"><<=
a href=3D"mailto:r.gomez [at] ingenia-soluciones.com">r.gomez [at] ingen ia-soluciones=
..com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;">
<div lang=3D"ES" link=3D"blue" vlink=3D"purple"><div><p class=3D"MsoNormal"=
><a name=3D"13054d6f00abbd54__MailEndCompose"><span lang=3D"EN-US" style=3D=
"font-size:11.0pt;color:#1F497D">I=92m afraid I don=92=92t understand you:<=
/span></a></p><p class=3D"MsoNormal">
<span lang=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">=A0</span></p=
><p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;colo=
r:#1F497D">=A0</span></p><p class=3D"MsoNormal"><span lang=3D"EN-US" style=
=3D"font-size:11.0pt;color:#1F497D">mysql> select count(*) from mysql.ti=
me_zone_name;</span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;color=
:#1F497D">+----------+</span></p><p class=3D"MsoNormal"><span lang=3D"EN-US=
" style=3D"font-size:11.0pt;color:#1F497D">| count(*) |</span></p><p class=
=3D"MsoNormal">
<span lang=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">+----------+<=
/span></p><p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11=
..0pt;color:#1F497D">|=A0=A0=A0=A0=A0=A0=A0 0 |</span></p><p class=3D"MsoNor=
mal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">+-------=
---+</span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;color=
:#1F497D">1 row in set (0.00 sec)</span></p><p class=3D"MsoNormal"><span la=
ng=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">=A0</span></p><p clas=
s=3D"MsoNormal">
<span lang=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">But, when I e=
xecute:</span></p><p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font=
-size:11.0pt;color:#1F497D">=A0</span></p><p class=3D"MsoNormal"><span lang=
=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">=A0</span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;color=
:#1F497D">mysql> select now();</span></p><p class=3D"MsoNormal"><span la=
ng=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">+------------------ --=
-+</span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;color=
:#1F497D">| now()=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 |</span></p><p =
class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;color:#1=
F497D">+---------------------+</span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;color=
:#1F497D">| 2011-06-03 11:28:00 |</span></p><p class=3D"MsoNormal"><span la=
ng=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">+------------------ --=
-+</span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;color=
:#1F497D">1 row in set (0.00 sec)</span></p><p class=3D"MsoNormal"><span la=
ng=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">=A0</span></p><p clas=
s=3D"MsoNormal">
<span lang=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">That=92s corr=
ect, in Spain it=92s that time. So, mysql is using the timezone correctly, =
isn=92t it?</span></p><div class=3D"im"><p class=3D"MsoNormal"><span lang=
=3D"EN-US" style=3D"font-size:11.0pt;color:#1F497D">=A0</span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;color=
:#1F497D">Thanks!</span></p><p class=3D"MsoNormal"><span lang=3D"EN-US" sty=
le=3D"font-size:11.0pt;color:#1F497D">=A0</span></p><p class=3D"MsoNormal">=
<b><span lang=3D"ES-PE" style=3D"font-size:10.0pt;color:#0070C0">Roc=EDo G=
=F3mez Escribano</span></b></p>
<p class=3D"MsoNormal"><a href=3D"mailto:r.sanchez [at] ingenia-soluciones.com" =
target=3D"_blank"><span lang=3D"ES-PE" style=3D"font-size:10.0pt">r.gomez [at] i=
ngenia-soluciones.com</span></a><span lang=3D"ES-PE" style=3D"font-size:10.=
0pt;color:#9D9D9D"></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;color:blue">=A0</spa=
n></p><p class=3D"MsoNormal"><span style=3D"font-size:9.0pt;color:#9D9D9D">=
<img border=3D"0" width=3D"181" height=3D"74" src=3D"cid:image001.jpg [at] 01CC2=
1E1.46848570" alt=3D"Descripci=F3n: cid:image002.jpg [at] 01CB8CB6.ADEBA830"></s=
pan><span style=3D"color:blue"></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;color:#A6A6A6">Pol=
=EDgono Campollano C/F, n=BA21T</span><span style=3D"font-size:10.0pt;color=
:blue"></span></p><p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;co=
lor:#9D9D9D">02007 Albacete (Espa=F1a)</span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB" style=3D"font-size:10.0pt;color=
:#9D9D9D">Tlf:967-504-513=A0 Fax: 967-504-513</span></p><p class=3D"MsoNorm=
al"><a href=3D"http://www.ingenia-soluciones.com" title=3D"blocked::www.ing=
enia-soluciones.com" target=3D"_blank"><span lang=3D"EN-GB" style=3D"font-s=
ize:10.0pt;color:#9D9D9D">www.ingenia-soluciones.com</span></a><span lang=
=3D"EN-GB" style=3D"font-size:10.0pt;color:#A6A6A6"></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;color=
:#1F497D">=A0</span></p></div><div style=3D"border:none;border-top:solid #B=
5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class=3D"MsoNormal"><b><span styl=
e=3D"font-size:10.0pt">De:</span></b><span style=3D"font-size:10.0pt"> John=
Daisley [mailto:<a href=3D"mailto:daisleyjohn [at] googlemail.com" target=3D"_b=
lank">daisleyjohn [at] googlemail.com</a>] <br>
<b>Enviado el:</b> viernes, 03 de junio de 2011 11:18<br><b>Para:</b> Rocio=
Gomez Escribano<br><b>CC:</b> <a href=3D"mailto:mysql [at] lists.mysql.com" tar=
get=3D"_blank">mysql [at] lists.mysql.com</a><br><b>Asunto:</b> Re: timezone</sp=
an></p>
</div><div class=3D"im"><p class=3D"MsoNormal">=A0</p><p class=3D"MsoNormal=
">Have you populated the timezone tables?=A0Run this query if you are not s=
ure.</p><div><p class=3D"MsoNormal">=A0</p></div><div><p class=3D"MsoNormal=
"><code><b><span style=3D"font-size:10.0pt">SELECT COUNT(*) FROM mysql.time=
_zone_name;</span></b></code></p>
</div><div><p class=3D"MsoNormal">=A0</p></div><div><p class=3D"MsoNormal">=
<b><span style=3D"font-family:"Courier New"">If it returns 0 then=
you need to populate the them as per the instructions here=A0<a href=3D"ht=
tp://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html" target=3D"_bla=
nk">http://dev.mysql.com/doc/refman/5.5/en/time-zone-support .html</a></span=
></b></p>
</div><div><p class=3D"MsoNormal">=A0</p></div><div><p class=3D"MsoNormal">=
Default timezone in mysql is set at server startup to SYSTEM, which means s=
o long as your system clock is correct the MySQL server should be correct.<=
/p>
</div><div><p class=3D"MsoNormal">=A0</p></div><div><p class=3D"MsoNormal">=
=A0</p></div></div><div><p class=3D"MsoNormal" style=3D"margin-bottom:12.0p=
t">=A0</p><div><div class=3D"im"><p class=3D"MsoNormal">On 3 June 2011 09:5=
5, Rocio Gomez Escribano <<a href=3D"mailto:r.gomez [at] ingenia-soluciones.c=
om" target=3D"_blank">r.gomez [at] ingenia-soluciones.com</a>> wrote:</p>
</div><div><div><div class=3D"im"><p class=3D"MsoNormal"><span lang=3D"EN-U=
S">Hello! I=92m having trouble with timezones.</span></p><p class=3D"MsoNor=
mal"><span lang=3D"EN-US">=A0</span></p><p class=3D"MsoNormal"><span lang=
=3D"EN-US">I=92m in Spain, we have 2 different timezone now we are in GMT+2=
, in winter, this is the GMT+1.</span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US">=A0</span></p><p class=3D"MsoNo=
rmal"><span lang=3D"EN-US">I=92m looking for an instruction which give me t=
he current timezone, but I cant find it! Do you know how can I now it?</spa=
n></p><p class=3D"MsoNormal">
<span lang=3D"EN-US">=A0</span></p><p class=3D"MsoNormal"><span lang=3D"EN-=
US">Thanks!</span></p><p class=3D"MsoNormal"><span lang=3D"EN-US">=A0</span=
></p><p class=3D"MsoNormal"><b><span lang=3D"ES-PE" style=3D"font-size:10.0=
pt;color:#0070C0">Roc=EDo G=F3mez Escribano</span></b></p>
<p class=3D"MsoNormal"><span lang=3D"ES-PE" style=3D"font-size:10.0pt;color=
:#9D9D9D"><a href=3D"mailto:r.sanchez [at] ingenia-soluciones.com" target=3D"_bl=
ank">r.gomez [at] ingenia-soluciones.com</a></span></p><p class=3D"MsoNormal"><s=
pan style=3D"color:blue">=A0</span></p>
</div><p class=3D"MsoNormal"><span style=3D"font-size:9.0pt;color:#9D9D9D">=
<b>=A1Error! Nombre de archivo no especificado.</b></span></p><div class=3D=
"im"><p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;color:#A6A6A6">=
Pol=EDgono Campollano C/F, n=BA21T</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;color:#9D9D9D">02007=
Albacete (Espa=F1a)</span></p><p class=3D"MsoNormal"><span lang=3D"EN-GB" =
style=3D"font-size:10.0pt;color:#9D9D9D">Tlf:967-504-513=A0 Fax: 967-504-51=
3</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;color:#A6A6A6"><a hr=
ef=3D"http://www.ingenia-soluciones.com" title=3D"blocked::www.ingenia-solu=
ciones.com" target=3D"_blank"><span lang=3D"EN-GB" style=3D"color:#9D9D9D">=
www.ingenia-soluciones.com</span></a></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US">=A0</span></p></div></div></div=
></div><div class=3D"im"><p class=3D"MsoNormal"><br><br clear=3D"all"><br>-=
- <br>John Daisley<br><br>Certified MySQL 5 Database Administrator<br>Certi=
fied MySQL 5 Developer<br>
Cognos BI Developer<br><br>Telephone: +44 (0)7918 621621<br>Email: <a href=
=3D"mailto:john.daisley [at] butterflysystems.co.uk" target=3D"_blank">john.dais=
ley [at] butterflysystems.co.uk</a></p></div></div></div></div></blockquote></di=
v>
<br><br clear=3D"all"><br>-- <br>John Daisley<div>Butterfly Information Sys=
tems<br><br>Microsoft SQL Server Database Administrator<div>Certified MySQL=
5 Database Administrator & Developer<br>Cognos BI Developer \ Administ=
rator=A0<br>
<br></div><div>Available for short & long term contracts</div><div><br>=
Telephone: +44 (0)7918 621621<br>Email: <a href=3D"mailto:john.daisley [at] butt=
erflysystems.co.uk">john.daisley [at] butterflysystems.co.uk</a></div></div><br>

</div></div></div>

--00163683415ebee6de04a4cbef1d--
--00163683415ebee6fa04a4cbef1e--
John Daisley [ Fr, 03 Juni 2011 12:08 ] [ ID #2060452 ]

Re: timezone

--=_2f030fdb-d654-4a5e-ad31-56d3472bbe44
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

I would also like to point out, as an aside, that Spain doesn't actually have two timezones - it has a single timezone with daylight savings time. The real question is, thus, to figure out wether or not you are on DST or not.

That, however, I have no idea how to do - the system takes care of it automagically. I'm not even sure it gets tracked somewhere on the system, you might need to download and parse the rules yourself in your code.

Unless, of course, you're talking about the timezone difference between Spain and the Canaries, but you mentioned summer/winter time explicitly, so I don't think so.

----- Original Message -----

> From: "John Daisley" <daisleyjohn [at] googlemail.com>
> To: "Rocio Gomez Escribano" <r.gomez [at] ingenia-soluciones.com>
> Cc: mysql [at] lists.mysql.com
> Sent: Friday, 3 June, 2011 12:08:34 PM
> Subject: Re: timezone

> now() returns the current system time which doesn't really have a
> great deal to do with time zones.

> You can check what the current time zone is set to with the following
> command

> show variables like 'time_zone';

> but that is likely to return the value ' SYSTEM ' which means it
> takes the value from the host operating system ( usually set in
> /etc/timezone ).

> You can set the time_zone variable either globally or per session to
> an offset of UTC as follows

> SET time_zone='+00:00:00';
> SET GLOBAL time_zone='+00:00:00';

> Or you can specify a ' default_time_zone ' in your my.cnf/my.ini
> options file.

> You can also set the time_zone variables to a named offset which will
> then take account of daylight savings times but to do this you must
> first load the mysql time zone tables.

> I strongly suggest you read the manual section relating to time zone
> support which you can find here

> http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.htm l

> On 3 June 2011 10:27, Rocio Gomez Escribano <
> r.gomez [at] ingenia-soluciones.com > wrote:

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

--=_2f030fdb-d654-4a5e-ad31-56d3472bbe44--
Johan De Meersman [ Fr, 03 Juni 2011 12:37 ] [ ID #2060455 ]

Re: timezone

--0016368342d19dcf6604a4cc6c49
Content-Type: text/plain; charset=ISO-8859-1

To take account of daylight savings time in MySQL, load the time zone tables
and set the `default_time_zone` variable to the named time zone for your
country.


On 3 June 2011 11:37, Johan De Meersman <vegivamp [at] tuxera.be> wrote:

> I would also like to point out, as an aside, that Spain doesn't actually
> have two timezones - it has a single timezone with daylight savings time.
> The real question is, thus, to figure out wether or not you are on DST or
> not.
>
> That, however, I have no idea how to do - the system takes care of it
> automagically. I'm not even sure it gets tracked somewhere on the system,
> you might need to download and parse the rules yourself in your code.
>
> Unless, of course, you're talking about the timezone difference between
> Spain and the Canaries, but you mentioned summer/winter time explicitly, so
> I don't think so.
>
>
> ------------------------------
>
> *From: *"John Daisley" <daisleyjohn [at] googlemail.com>
> *To: *"Rocio Gomez Escribano" <r.gomez [at] ingenia-soluciones.com>
> *Cc: *mysql [at] lists.mysql.com
> *Sent: *Friday, 3 June, 2011 12:08:34 PM
> *Subject: *Re: timezone
>
>
> now() returns the current system time which doesn't really have a great
> deal to do with time zones.
>
> You can check what the current time zone is set to with the following
> command
>
> *show variables like 'time_zone';*
>
> but that is likely to return the value '*SYSTEM*' which means it takes the
> value from the host operating system ( usually set in /etc/timezone ).
>
> You can set the time_zone variable either globally or per session to an
> offset of UTC as follows
>
> *SET time_zone='+00:00:00';*
> *SET GLOBAL time_zone='+00:00:00';*
>
> Or you can specify a '*default_time_zone*' in your my.cnf/my.ini options
> file.
>
> You can also set the time_zone variables to a named offset which will then
> take account of daylight savings times but to do this you must first load
> the mysql time zone tables.
>
> I strongly suggest you read the manual section relating to time zone
> support which you can find here
>
> http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.htm l
>
>
>
> On 3 June 2011 10:27, Rocio Gomez Escribano <
> r.gomez [at] ingenia-soluciones.com> wrote:
>
>
>
>
>
> --
> Bier met grenadyn
> Is als mosterd by den wyn
> Sy die't drinkt, is eene kwezel
> Hy die't drinkt, is ras een ezel
>



--
John Daisley
Butterfly Information Systems

Microsoft SQL Server Database Administrator
Certified MySQL 5 Database Administrator & Developer
Cognos BI Developer \ Administrator

Available for short & long term contracts

Telephone: +44 (0)7918 621621
Email: john.daisley [at] butterflysystems.co.uk

--0016368342d19dcf6604a4cc6c49--
John Daisley [ Fr, 03 Juni 2011 12:43 ] [ ID #2060456 ]

RE: timezone

------=_NextPart_000_0089_01CC21DB.5CF13D90
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable

From: John Daisley [mailto:daisleyjohn [at] googlemail.com]
Sent: Friday, June 03, 2011 6:09 AM
To: Rocio Gomez Escribano
Cc: mysql [at] lists.mysql.com
Subject: Re: timezone



now() returns the current system time which doesn't really have a great =
deal to do with time zones.



[JS] I think that statement is confusing =E2=80=93 at least, it is to =
me. Unless you specify otherwise, NOW() returns the current system time =
in the system=E2=80=99s time zone. Your comment could be interpreted to =
mean that it doesn=E2=80=99t use any time zone: i.e., that it returns =
the UTC.





Regards,



Jerry Schwartz

Global Information Incorporated

195 Farmington Ave.

Farmington, CT 06032



860.674.8796 / FAX: 860.674.8341

E-mail: jerry [at] gii.co.jp

Web site: www.the-infoshop.com <http://www.the-infoshop.com/>







You can check what the current time zone is set to with the following =
command



show variables like 'time_zone';



but that is likely to return the value 'SYSTEM' which means it takes the =
value from the host operating system ( usually set in /etc/timezone ).



You can set the time_zone variable either globally or per session to an =
offset of UTC as follows



SET time_zone=3D'+00:00:00';

SET GLOBAL time_zone=3D'+00:00:00';



Or you can specify a 'default_time_zone' in your my.cnf/my.ini options =
file.



You can also set the time_zone variables to a named offset which will =
then take account of daylight savings times but to do this you must =
first load the mysql time zone tables.



I strongly suggest you read the manual section relating to time zone =
support which you can find here



http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.htm l







On 3 June 2011 10:27, Rocio Gomez Escribano =
<r.gomez [at] ingenia-soluciones.com> wrote:

I=E2=80=99m afraid I don=E2=80=99=E2=80=99t understand you:





mysql> select count(*) from mysql.time_zone_name;

+----------+

| count(*) |

+----------+

| 0 |

+----------+

1 row in set (0.00 sec)



But, when I execute:





mysql> select now();

+---------------------+

| now() |

+---------------------+

| 2011-06-03 11:28:00 |

+---------------------+

1 row in set (0.00 sec)



That=E2=80=99s correct, in Spain it=E2=80=99s that time. So, mysql is =
using the timezone correctly, isn=E2=80=99t it?



Thanks!



Roc=C3=ADo G=C3=B3mez Escribano

<mailto:r.sanchez [at] ingenia-soluciones.com> =
r.gomez [at] ingenia-soluciones.com



Descripci=C3=B3n: cid:image002.jpg [at] 01CB8CB6.ADEBA830

Pol=C3=ADgono Campollano C/F, n=C2=BA21T

02007 Albacete (Espa=C3=B1a)

Tlf:967-504-513 Fax: 967-504-513

<http://www.ingenia-soluciones.com> www.ingenia-soluciones.com



De: John Daisley [mailto:daisleyjohn [at] googlemail.com]
Enviado el: viernes, 03 de junio de 2011 11:18
Para: Rocio Gomez Escribano
CC: mysql [at] lists.mysql.com
Asunto: Re: timezone



Have you populated the timezone tables? Run this query if you are not =
sure.



SELECT COUNT(*) FROM mysql.time_zone_name;



If it returns 0 then you need to populate the them as per the =
instructions here =
http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.htm l



Default timezone in mysql is set at server startup to SYSTEM, which =
means so long as your system clock is correct the MySQL server should be =
correct.







On 3 June 2011 09:55, Rocio Gomez Escribano =
<r.gomez [at] ingenia-soluciones.com> wrote:

Hello! I=E2=80=99m having trouble with timezones.



I=E2=80=99m in Spain, we have 2 different timezone now we are in GMT+2, =
in winter, this is the GMT+1.



I=E2=80=99m looking for an instruction which give me the current =
timezone, but I cant find it! Do you know how can I now it?



Thanks!



Roc=C3=ADo G=C3=B3mez Escribano

r.gomez [at] ingenia-soluciones.com <mailto:r.sanchez [at] ingenia-soluciones.com> =




=C2=A1Error! Nombre de archivo no especificado.

Pol=C3=ADgono Campollano C/F, n=C2=BA21T

02007 Albacete (Espa=C3=B1a)

Tlf:967-504-513 Fax: 967-504-513

<http://www.ingenia-soluciones.com> www.ingenia-soluciones.com






--
John Daisley

Certified MySQL 5 Database Administrator
Certified MySQL 5 Developer
Cognos BI Developer

Telephone: +44 (0)7918 621621
Email: john.daisley [at] butterflysystems.co.uk




--
John Daisley

Butterfly Information Systems

Microsoft SQL Server Database Administrator

Certified MySQL 5 Database Administrator & Developer
Cognos BI Developer \ Administrator

Available for short & long term contracts


Telephone: +44 (0)7918 621621
Email: john.daisley [at] butterflysystems.co.uk




------=_NextPart_000_0089_01CC21DB.5CF13D90--
Jerry Schwartz [ Fr, 03 Juni 2011 16:45 ] [ ID #2060460 ]
Datenbanken » gmane.comp.db.mysql.general » TimeZone

Vorheriges Thema: Remote access of MySQL
Nächstes Thema: Allowing all users to access a specified database