How can I implement a time-zone variable on my site?

by Chris-
6 replies
I have never done any web-programming before, but I do have practical experience with C, Basic and WinAutomation, so I understand programming concepts, but not how to get programming to do something on a webpage.

What I want to do is, according to the user's radio-button selection of their own Time-Zone, to then change times showing elsewhere on the page (for a booking systems), so that each time shows in the users time-zone. I presume I just need to get the selection of time-zone to set a variable, and then use that variable to add to the time-definition of existing times, although I guess it's not that simple because it also needs to change the date if the time goes onto the next day.

I am hosting on BlueHost, and the page will be a simple Html page. I looked at existing scheduling systems (such as SuperSaas) but they are not ideal in other ways (their time-zone function is wierd, plus there's no easy way of integrating affiliate codes into their system).

So, can any one tell me how to do that, what language to use, and how to do it all, or point me at free code somewhere which will allow me to get it done.

thanks!


Chris
#implement #site #timezone #variable
  • Profile picture of the author Terry Crim
    Sounds like you need a custom solution. Just implementing time zone options in a page is rather simple. If you search google, bing, yahoo or other search engines you will find hundreds of solutions some paid many free solutions just for that.

    When you mentioned affiliates id's needing injecting then this is more than just a simple html page. Are you using an affiliate script currently? If so, will this page be part of that?

    I need more information about this than what you have posted so far. It is rather simple to do the time zone thing and that can be done with ajax and no server side scripting at all. I mean like PHP where the server itself is handling things and not the visitors/customers web browser.
    {{ DiscussionBoard.errors[5625499].message }}
  • Profile picture of the author Chris-
    hi Terry,

    thanks very much for your reply.

    For the affiliate handling, I am considering starting with a simple method such as duplicating the booking page once for each affiliate, then giving the affiliates a link which sends clients to the affiliate's unique page, which then adds a unique code into the booking Form as it's emailed to me (I know how to do that bit already), just to keep things simple. I was looking at JVzoo, but my service is unusual in that I know there will be a lot of refunds, so I don't want to risk having the customers pay when they book, because if I get lots of refunds it makes it more likely for PayPal to suspend my account or refund every customer I've ever had, or whatever crazy things they do! So as far as I can see, that means I can't eaily use JVzoo (because the clients are booking first, getting the session, then paying later if they appreciate the service), so I have to track which affiliate the order is comming from, when the client books the time, hence this approach. I'm sure there are better ways to do it once I can afford to pay a programmer, but I like seeing if a system is profitable as quickly as cheaply as possible, then only improving it later if it's profitable.

    So I guess I'll Google "Ajax time-zone code" and see what I can find.

    Thanks!!

    Chris
    {{ DiscussionBoard.errors[5625570].message }}
  • Profile picture of the author webpeon
    should be simple enough to do with a little code, cant comment on php (0 experience) but it would be easy enough to do in c# using asp.net, theres free developers software available to do this (visual web developers express) the only catch is youre going to need to use a windows based server to host on if you take this option, additionally adding mssql as well would simplify the affiliates section if you can wrap you head around some sql commands and data view controls that is.


    c# asp example

    The time zone adjustments will be done by using the host servers machine time

    controls:
    rbtnTimeZoneNZ - a radio button to select timezone, autopostback = true
    lblDateInCurrentTimeZone - the date in the current selected time zones format


    codebehind:

    Code:
            public double hoursDifference;
            public double minutesDifference;
    
            protected void rbtnTimeZoneNZ_CheckedChanged(object sender, EventArgs e)
            {
                
                if (rbtnTimeZoneNZ.Checked == true)
                {
                    hoursDifference = 2;
                    minutesDifference = 30;
                }
    
                DateTime newTime = new DateTime();
                    newTime = DateTime.Now.AddHours(hoursDifference);
                    newTime = newTime.AddMinutes(minutesDifference);
                    lblDateInCurrentTimeZone.Text = newTime.ToString();
                    
            }
    if the button is checked the page posts back with new time zone time, it works with negative timezones as well and you can tweak the final format to get it to display how you want it


    good luck with whichever option you decide to go with.
    Signature
    Web 2 Mobile
    The Future of The Web
    {{ DiscussionBoard.errors[5625856].message }}
  • Profile picture of the author Chris-
    Thanks WebPeon, but I don't think my Server is Windows-based.

    thanks anyway!

    Chris
    {{ DiscussionBoard.errors[5625866].message }}
  • Profile picture of the author webpeon
    no probs, just throwing it out there, keeping the brain ticking along while i should be doing real work lol
    Signature
    Web 2 Mobile
    The Future of The Web
    {{ DiscussionBoard.errors[5625931].message }}
    • Profile picture of the author Chris-
      Originally Posted by webpeon View Post

      no probs, just throwing it out there, keeping the brain ticking along while i should be doing real work lol


      I am finding some Ajax code that is doing the right kind of things, so I'll keep investigating that and see if I can understand enough to make it do what I want!

      cheers

      Chris
      {{ DiscussionBoard.errors[5625960].message }}

Trending Topics