MySQL: zipcode to timezone

  • hiepnguyen / 116 / Mon, 21 Sep 2009 19:15:00 GMT / Comments (9)
  • Hi there,

    we have warehouses all over U.S. and i just wonder what is the best way to find out their timezone base on zipcode. Should i buy a database or is there any function in mysql or php to get timezone base on a zipcode?

    Thanks
  • Keywords:

    zipcode, timezone, mysql

  • http://database.itags.org/mysql/62272/«« Last Thread - Next Thread »»
    1. Fri, 6 Jul 2007, David T. Ashley wrote:

      7/6/07, Hiep Nguyen <hiep (AT) ee (DOT) ucr.eduwrote:
      >
      >we have warehouses all over U.S. and i just wonder what is the best way to
      >find out their timezone base on zipcode. Should i buy a database or is
      >there any function in mysql or php to get timezone base on a zipcode?
      >
      >

      I looked at the zipcode databases not as expensive as I would have
      thought. It might be worth it just to spend the $100 or so.

      However,

      My understanding is that U.S. zipcodes have their first two digits based on
      state, i.e. "48" is Michigan.

      Since most of the time zone boundaries seem to fall on state boundaries, a
      simple mapping from the first two digits to the time zone might get you most
      of the way there.

      %3Fq%3Du.s.%2Btime%2Bzone%2Bmap%26um%

      However, for those states that are split, I don't know an easy way but
      there shouldn't be very many of those.

      Dave.

      i don't think there is any state got 2 timezones, i could be wrong. but
      if that the case, state -timezone is working for me. now, how do i look
      up for timezone if i got state? i don't mind buying the database, but i
      just don't want to replace the database if something change down the road.

      thanks
      T. Hiep

      hiepnguyen | Tues, 06 May 2008 20:13:00 GMT |

    2. Hiep Nguyen wrote:
      Hi there,

      we have warehouses all over U.S. and i just wonder what is the best way
      to find out their timezone base on zipcode. Should i buy a database or
      is there any function in mysql or php to get timezone base on a zipcode?

      You may be able to call a web service from your PHP code to find this out.

      baronschwartz | Tues, 06 May 2008 20:14:00 GMT |

    3. 7/6/07, Hiep Nguyen <hiep (AT) ee (DOT) ucr.eduwrote:

      we have warehouses all over U.S. and i just wonder what is the best way to
      find out their timezone base on zipcode. Should i buy a database or is
      there any function in mysql or php to get timezone base on a zipcode?

      I looked at the zipcode databases not as expensive as I would have
      thought. It might be worth it just to spend the $100 or so.

      However,

      My understanding is that U.S. zipcodes have their first two digits based on
      state, i.e. "48" is Michigan.

      Since most of the time zone boundaries seem to fall on state boundaries, a
      simple mapping from the first two digits to the time zone might get you most
      of the way there.

      %3Fq%3Du.s.%2Btime%2Bzone%2Bmap%26um%

      However, for those states that are split, I don't know an easy way but
      there shouldn't be very many of those.

      Dave.

      davidt_ashley | Tues, 06 May 2008 20:15:00 GMT |

    4. Message
      From: Hiep Nguyen [mailto:hiep (AT) ee (DOT) ucr.edu]
      Sent: Friday, July 06, 2007 10:51 AM
      To: David T. Ashley
      Cc: mysql (AT) lists (DOT) mysql.com
      Subject: Re: zipcode to timezone

      i don't think there is any state got 2 timezones, i could be wrong.

      Yeah, you are.

      INFRMATIN IN THIS MESSAGE, INCLUDING ANY ATTACHMENTS, IS INTENDED FR THE PERSNAL AND CNFIDENTIAL USE F THE INTENDED RECIPIENT(S) NAMED ABVE. If you are not an intended recipient of this message, or an agent responsible for delivering it to an intended recipient, you are hereby notified that you have received this message in error, and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you received this message in error, please notify the sender immediately, delete the message, and return any hard copy print-outs.

      johntrammell | Tues, 06 May 2008 20:16:00 GMT |

    5. 7/6/07, John Trammell <johnt (AT) holmescorp (DOT) comwrote:

      Message
      From: Hiep Nguyen [mailto:hiep (AT) ee (DOT) ucr.edu]
      Sent: Friday, July 06, 2007 10:51 AM
      To: David T. Ashley
      Cc: mysql (AT) lists (DOT) mysql.com
      Subject: Re: zipcode to timezone

      i don't think there is any state got 2 timezones, i could be wrong.

      Yeah, you are.

      other thought comes to mind. Is there a guarantee that a timezone can't
      split a zipcode?

      In other words, is the mapping from zipcode->timezone guaranteed to exist in
      all cases?

      I remember a friend in Tennessee who would take her children to school (10
      miles away) and the school was in a different timezone than her home, so it
      got very confusing what time the kids had to be up and to bed and all that.

      In rural areas where the zipcodes can be rather large, I'm just wondering if
      there is any guarantee that a zipcode can't span two timzones.

      davidt_ashley | Tues, 06 May 2008 20:17:00 GMT |

    6. Indiana has two time zones as I recall. The state is divided roughly in
      half between the two.

      Dirk Bremer - Senior Systems Engineer - Utility - AMS - NISC Lake St.
      Louis M - USA Central Time Zone
      636-755-2652 fax 636-755-2502 dirk.bremer (AT) nisc (DOT) coop www.nisc.coop

      Message
      From: Hiep Nguyen [mailto:hiep (AT) ee (DOT) ucr.edu]
      Sent: Friday, July 06, 2007 10:51
      To: David T. Ashley
      Cc: mysql (AT) lists (DOT) mysql.com
      Subject: Re: zipcode to timezone

      Fri, 6 Jul 2007, David T. Ashley wrote:

      7/6/07, Hiep Nguyen <hiep (AT) ee (DOT) ucr.eduwrote:
      >
      >we have warehouses all over U.S. and i just wonder what is the best

      way to
      >find out their timezone base on zipcode. Should i buy a database or

      is
      >there any function in mysql or php to get timezone base on a zipcode?
      >
      >

      I looked at the zipcode databases not as expensive as I would have
      thought. It might be worth it just to spend the $100 or so.

      However,

      My understanding is that U.S. zipcodes have their first two digits
      based on
      state, i.e. "48" is Michigan.

      Since most of the time zone boundaries seem to fall on state
      boundaries, a
      simple mapping from the first two digits to the time zone might get
      you most
      of the way there.
      --

      %3Fq%3Du.s.%2Btime%2Bzone%2B
      map%26um%

      However, for those states that are split, I don't know an easy way
      but
      there shouldn't be very many of those.

      Dave.

      i don't think there is any state got 2 timezones, i could be wrong. but

      if that the case, state -timezone is working for me. now, how do i
      look
      up for timezone if i got state? i don't mind buying the database, but i

      just don't want to replace the database if something change down the
      road.

      thanks
      T. Hiep

      dirkbremer | Tues, 06 May 2008 20:18:00 GMT |

    7. I think Indiana has two time zones. I think there are also some states or
      portions thereof that don't observe daylight saving time.

      Regards,

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

      860.674.8796 / FAX: 860.674.8341

      www.the-infoshop.com
      www.giiexpress.com
      www.etudes-marche.com

      Message
      From: Hiep Nguyen [mailto:hiep (AT) ee (DOT) ucr.edu]
      Sent: Friday, July 06, 2007 11:51 AM
      To: David T. Ashley
      Cc: mysql (AT) lists (DOT) mysql.com
      Subject: Re: zipcode to timezone

      Fri, 6 Jul 2007, David T. Ashley wrote:

      7/6/07, Hiep Nguyen <hiep (AT) ee (DOT) ucr.eduwrote:
      >>

      >we have warehouses all over U.S. and i just wonder what is

      the best way to
      >find out their timezone base on zipcode. Should i buy a

      database or is
      >there any function in mysql or php to get timezone base on

      a zipcode?
      --
      I looked at the zipcode databases not as expensive as I
      would have
      thought. It might be worth it just to spend the $100 or so.

      However,

      My understanding is that U.S. zipcodes have their first two
      digits based on
      state, i.e. "48" is Michigan.

      Since most of the time zone boundaries seem to fall on
      state boundaries, a
      simple mapping from the first two digits to the time zone
      might get you most
      of the way there.
      --

      1&tbnw=126&prev=/images%3Fq%3Du.s.%2Btime%2Bzone%2Bmap%26um%3D

      However, for those states that are split, I don't know an
      easy way but
      there shouldn't be very many of those.

      Dave.
      --
      i don't think there is any state got 2 timezones, i could be
      wrong. but
      if that the case, state -timezone is working for me. now,
      how do i look
      up for timezone if i got state? i don't mind buying the
      database, but i
      just don't want to replace the database if something change
      down the road.

      thanks
      T. Hiep

      jerryschwartz | Tues, 06 May 2008 20:19:00 GMT |

    8. Fri, 6 Jul 2007, Dirk Bremer wrote:

      Indiana has two time zones as I recall. The state is divided roughly in
      half between the two.

      Dirk Bremer - Senior Systems Engineer - Utility - AMS - NISC Lake St.
      Louis M - USA Central Time Zone
      636-755-2652 fax 636-755-2502 dirk.bremer (AT) nisc (DOT) coop www.nisc.coop

      Message
      From: Hiep Nguyen [mailto:hiep (AT) ee (DOT) ucr.edu]
      Sent: Friday, July 06, 2007 10:51
      To: David T. Ashley
      Cc: mysql (AT) lists (DOT) mysql.com
      Subject: Re: zipcode to timezone

      Fri, 6 Jul 2007, David T. Ashley wrote:
      >
      >7/6/07, Hiep Nguyen <hiep (AT) ee (DOT) ucr.eduwrote:


      we have warehouses all over U.S. and i just wonder what is the best
      way to
      find out their timezone base on zipcode. Should i buy a database or
      is
      there any function in mysql or php to get timezone base on a zipcode?
      >>
      >>

      >I looked at the zipcode databases not as expensive as I would have
      >thought. It might be worth it just to spend the $100 or so.
      >>

      >However,
      >>

      >My understanding is that U.S. zipcodes have their first two digits

      based on
      >state, i.e. "48" is Michigan.
      >>

      >Since most of the time zone boundaries seem to fall on state

      boundaries, a
      >simple mapping from the first two digits to the time zone might get

      you most
      >of the way there.
      >>
      >>


      %3Fq%3Du.s.%2Btime%2Bzone%2B
      map%26um%
      >>

      >However, for those states that are split, I don't know an easy way

      but
      >there shouldn't be very many of those.
      >>

      >Dave.
      >>

      >

      i don't think there is any state got 2 timezones, i could be wrong. but

      if that the case, state -timezone is working for me. now, how do i
      look
      up for timezone if i got state? i don't mind buying the database, but i

      just don't want to replace the database if something change down the
      road.

      thanks
      T. Hiep

      hiepnguyen | Tues, 06 May 2008 20:20:00 GMT |

    9. Message
      From: Hiep Nguyen [mailto:hiep (AT) ee (DOT) ucr.edu]
      Sent: Friday, July 06, 2007 12:15 PM
      To: Dirk Bremer
      Cc: David T. Ashley; mysql (AT) lists (DOT) mysql.com
      Subject: RE: zipcode to timezone

      now, why do they do this? it doesn't make any sense at all to have
      multiple timezones in a state, at least to me. men, they have too much
      time in their hand and this is they came up, two timezones in a state.

      Me neither. I was interested to learn that there are noticeable energy savings associated with the Daylight Savings time change. Who'd a thunk it?

      JT

      INFRMATIN IN THIS MESSAGE, INCLUDING ANY ATTACHMENTS, IS INTENDED FR THE PERSNAL AND CNFIDENTIAL USE F THE INTENDED RECIPIENT(S) NAMED ABVE. If you are not an intended recipient of this message, or an agent responsible for delivering it to an intended recipient, you are hereby notified that you have received this message in error, and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you received this message in error, please notify the sender immediately, delete the message, and return any hard copy print-outs.

      johntrammell | Tues, 06 May 2008 20:21:00 GMT |

  • MySQL Questions

    • Changing DATADIR

      Hi,I installed MySql with the default settings. But I'd like now to change the place where I keep my...

      By jeanvaillancourt

    • newbie installing mysql

      I am stuck i just cant get mysql running as a service on xp pro imusing version4.0.17 win i have ins...

      By jimmy

    • index

      Not sure how indexes work with ORDER BY and GROUP BY.What index should I create which will be used o...

      By john

    • finding next and prev record in mysql

      This good for giving me the next recorded but it will not give me the prevrecorded that is the one I...

      By richardkurth

    • how to default ... DATE column to another column d...

      I have a similar desire like my first question regarding a DATETIME field. Ihave a DATETIME field in...

      By ferindomiddleton

    • innodb to be removed? and...

      Hi all,recently someone said to know alot about mysql told us that InnoDB is about tobe removed from...

      By christianparpart

    • Supreme feature masterpiece!

      Deserve the best impression by wearing our low priced masterpiece.Our establishment's chronometers a...

      By ashley_jarmon

    • Cleanup of connections

      Hi,I've noticed that connections are sometimes left open in http://www.droptable.com/MySQL_Server_Su...

      By bensmith, 6 Comments

    • Efficient best sellers list

      I need to display a best selling product list but I'm clueless as to the best implementation. I...

      By triune, 3 Comments

    • Closing Statements and ResultSets

      I have noticed that Connector/J 3.1.x is very strict about making sureto close all of your Statement...

      By kenbloom, 6 Comments

    • Importing from Visual Foxpro

      I have some Visual Foxpro tables that I want to convert to tables in a MySQLdatabase. VFP contains n...

      By andrewchalk, 1 Comments

    • Limit on fulltext match?

      --=_NextPart_000_03D2_01C59C4C.061D53C0Content-Type: text/plain;charset="iso-8859-1"Content-Transfer...

      By hbb, 1 Comments

    • Blob question

      I'm just getting into the whole mysql (was using access). Is it betterto create a Blob type and...

      By stevegrosz, 1 Comments

    • Data loss problem with mysql

      --_=_NextPart_001_01C4D1F4.930558F5Content-Type: text/plain;charset="us-ascii"Content-Transfer-Encod...

      By hbb, 2 Comments

    • Trouble with setting the password on a user with t...

      Hi, in eventum 1.5.4, I have trouble with setting a password for a userwith the role of customer.I&#...

      By mariaoberg, 1 Comments