Timezone Change

Discussion in 'Classic ASP' started by homeacademy, Feb 5, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Here's my problem: I understand that DiscountASP is located in CA and the server timezone is set to PST. I am on the east coast and need the time/date reported by the ASP 'now' function, etc to report in EST. I understand I can program in a time adjustment, but my website is complicated with a huge number of pages and I don't have the time to go though and make this change everywhere in every page (if I could even find all the instances).

    I would really like to have an option in my control panel to choose a different timezone for my account. Is this possible? Would you be willing to implement this feature? Note that I am using classic ASP (not .NET). Thanks in advance.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Does this post help?

    http://forum.discountasp.net/topic.asp?TOPIC_ID=135

    quote:Originally posted by homeacademy

    Here's my problem: I understand that DiscountASP is located in CA and the server timezone is set to PST. I am on the east coast and need the time/date reported by the ASP 'now' function, etc to report in EST. I understand I can program in a time adjustment, but my website is complicated with a huge number of pages and I don't have the time to go though and make this change everywhere in every page (if I could even find all the instances).

    I would really like to have an option in my control panel to choose a different timezone for my account. Is this possible? Would you be willing to implement this feature? Note that I am using classic ASP (not .NET). Thanks in advance.
    </blockquote id="quote"></font id="quote">
     
  3. Thanks everyone for the help. Since my idea cannot be done (according to DASP) I will try something like pjoyce suggested (thanks!). I do have an include file on every page already so it should be pretty straightforward, just a little less efficent. Thanks!
     
  4. quote:Originally posted by bruce

    Does this post help?

    http://forum.discountasp.net/topic.asp?TOPIC_ID=135
    </blockquote id="quote"></font id="quote">

    Thank you for your reply. No, that post doesn't really help with what I'm getting at. Clarification: All my users are in EST, so I know the offset to use. The problem is my application is coded using the ASP 'now' function to get the current time (was written on an EST server). Now that I've moved to you, I really don't want to go through and modify each call to 'now' to change the timezone offset. That would take me a VERY long time [:(] What I was hoping for is to change the time reported by any call to the server time. Essentially change the server timezone from PST to EST for my account. Is that possible?
     
  5. Takeshi Eto

    Takeshi Eto DiscountASP.NET Staff

    Sorry, this is not possible.
     
  6. Unfortunately MS pulls the time from the server time settings. In fact, using classic ASP the FormatDate() function formats the output string according to the settings on the server. Not the best design decision IMHO, esp. for a hosted environment. But enough complaining, on to the useful stuff...

    Were I in you shoes, I would create an <include> file which has a function like ESTNow() which gets the current time and converts to eastern time. If you already have an include file included on every page, like a header or footer, I'd put the ASP code in that. Then I'd use something like textpad(www.textpad.com/download) and do a global search and replace, replacing all instances of Now() with ESTNow().

    Since TextPad (or most other text editing programs) can use regular expressions, you can also use this to insert your Include file. Just search for something that is in every file, like </html> and replace with </html>\r\n<#include file="filepath.inc">\r\n

    Good luck, hope this helps!

    ps: check on the <!--include> syntax. I haven't used ASP in a while and the above doesn't look quite right...


    quote:Originally posted by homeacademy

    quote:Originally posted by bruce

    Does this post help?

    http://forum.discountasp.net/topic.asp?TOPIC_ID=135
    </blockquote id="quote"></font id="quote">

    Thank you for your reply. No, that post doesn't really help with what I'm getting at. Clarification: All my users are in EST, so I know the offset to use. The problem is my application is coded using the ASP 'now' function to get the current time (was written on an EST server). Now that I've moved to you, I really don't want to go through and modify each call to 'now' to change the timezone offset. That would take me a VERY long time [:(] What I was hoping for is to change the time reported by any call to the server time. Essentially change the server timezone from PST to EST for my account. Is that possible?
    </blockquote id="quote"></font id="quote">
     
  7. homeacademy:
    Regarding changes that need to be made to many web pages (even though you may or many not want to do so in this particular case), I have found the free program Text Exchange to be an invaluable tool and highly accurate. See: http://www.pconsulting.com.au/textexchange/
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page