Time compared to GMT - Have to use server's c

Results 1 to 2 of 2

Thread: Time compared to GMT - Have to use server's c

  1. #1
    KdS Guest

    Default Time compared to GMT - Have to use server's c

    I have the following code in my page and working to give me GMT time based on my servers clock...<BR>&#060;%<BR> GMTTime = DateAdd("h",6,time()) &#039; For Dallas<BR>%&#062;<BR><BR>What I need is some sort of formula or whatever, still using my server&#039;s time (ASP), that will do a calculation for a time based on a &#039;location&#039;. For instance..I have a database that holds &#039;location&#039; information in a table. One of the fields is a "GMT Offset" field. So it might read GMT - 6 for Chicago time or GMT - 0 for London time. How can I, using my server&#039;s clock, compare this GMT Offset field to GMT time and print it out to an ASP page?????? Please Help

  2. #2
    Join Date
    Dec 1969

    Default You've already got the answer....

    If the DB field simply contains a *NUMBER* only, then all you need to do is<BR><BR>locationTime = DateAdd("h", RS("gmtOffset"), GMTTime )<BR><BR>Right? No different than the basic way you got the GMTTime in the first place.<BR><BR>Remember, numbers in a DB *can* be negative, so this is no problem.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts