Timezone Confussion -> convert_to_gmt -> daylight saving zones / Am I right ? Or wrong |
[eluser]brototyp[/eluser]
Hi jedd, first i want to say thank you for your fast reply. I appreciate that :exclaim: I'm very happy to here that the idea of my approach is correct, so all these days reading and banging my head against a wall wasn't useless ;-P Before I tell you about my database construction I have to make some adaption to my description about the problem, that I want to solve. I mean the problem is the same but my description wasn't quite correct. What i want to do is to build a memorization tool for users (Europe Timezone UP1). European users can add events (online events, for example: Multiplayer Games) from a other timezone which are mostly in ET (Eastern Time, which I think is UM5 Timezone). The European user add the event in UM5, and my tool should display this event in the Eurpean Time --> UP1. Example: There is an online event in UM5 timezone. The Eurpean user adds the event and my tool should give him the correct time in his timezone, so he knows exactly when to meet up online. I uploaded a version to my server, where you can log in, add an event and see the result. (I think this way is more easy to explain ......... :coolsmile: ) That's the link username: dude2 password: dude2 Everything works perfectly so far. The user adds the event date which is in UM5 and the date displayed for him is in UP1. (Eventdate UM5 which is saved in DB in GMT and which is converted to users timezone .....) If there weren't any Day Saving Times on globe, this post here would be unnecessary :lol: , I come to that part later. The table for a user look like this: userid[bigint(20)]<- Primary key <- auto increment, username[varchar(50)], password[varchar(50)], email[varchar(50)], key[varchar(50)], timezone[varchar(5)] The table for the events look like this: eventid[bigint(20)]<- Primary key <- auto increment, userid[bigint(20)], name[varchar(50)], desc[varchar(50)], date[datetime], client[varchar(50)]; There is also an client table. By adding an event the user chooses a client in which the information about the timezone is saved (in my case usually UM5). The client table looks like this: clientid[bigint(20)]<- Primary key <- auto increment, name[varchar(50)], timezone[varchar(50)] I also give you acces to my database, that you can log in and see how I build it: Here is the link to my database Username: sql7940_990243 Password: afterglow Here is what I do in my controller, when a user adds an event the date and the event information is added to the database. Please don't laugh about my code, I'm still new in PHP (programming) and I have a feeling that what I do can be made much more elegant, but it works.... :coolsmirk: Code: $xy = $mydatum.$stunde.$minute.'00'; // Here is what I do in my controller when the users shows the events. Code: function index() Here is my view to show the events. I do a little controller stuff here (Take the GMT date and make it to UP1). I know I shouldn't do this in the view but I don't know better at the moment. :roll: Code: <?php foreach($eventdata->result() as $row): |
Messages In This Thread |
Timezone Confussion -> convert_to_gmt -> daylight saving zones / Am I right ? Or wrong - by El Forum - 06-16-2009, 11:58 AM
Timezone Confussion -> convert_to_gmt -> daylight saving zones / Am I right ? Or wrong - by El Forum - 06-16-2009, 04:27 PM
Timezone Confussion -> convert_to_gmt -> daylight saving zones / Am I right ? Or wrong - by El Forum - 06-17-2009, 11:30 AM
Timezone Confussion -> convert_to_gmt -> daylight saving zones / Am I right ? Or wrong - by El Forum - 06-17-2009, 01:27 PM
Timezone Confussion -> convert_to_gmt -> daylight saving zones / Am I right ? Or wrong - by El Forum - 06-17-2009, 02:59 PM
Timezone Confussion -> convert_to_gmt -> daylight saving zones / Am I right ? Or wrong - by El Forum - 06-27-2009, 02:55 PM
|