Results 1 to 3 of 3

Thread: Pacific Time

  1. #1

    Thread Starter
    New Member
    Join Date
    May 1999
    Location
    encino, ca USA
    Posts
    2

    Unhappy Pacific Time

    I'm trying to get pacific time from a server that is located in the east coast ...using the server side time funcation...without subtracting three hours.
    any idea ?
    i'll show you what i did ...
    thetime = Time()
    thehour = hour(thetime)
    themin = minute(thetime)
    thesec = second(thetime)
    entertime = timeSerial(thehour - 3, themin - 15, thetime)

    but for some reason when it get to three hours before 12 pm or three hours before 12 minnight it stops working ...why ?

    If anyone knows of an easier way please send me Private msg or e-mail me at [email protected].

    Thanks,

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    Why dont you just use the dateadd function:

    Code:
    DateAdd(DateInterval.Hour, -3, thetime)

  3. #3

    Thread Starter
    New Member
    Join Date
    May 1999
    Location
    encino, ca USA
    Posts
    2

    I just used this...

    thetime = Time()
    thehour = hour(thetime)
    themin = minute(thetime)
    thesec = second(thetime)
    thetime1 = right(thetime, 2)

    if ((thetime1 = "PM") and (thehour >= 4)) then
    lenthemin = len(themin)
    if lenthemin = 1 then
    themin = "0" & themin
    end if
    lenthesec = len(thesec)
    if lenthesec = 1 then
    thesec = "0" & thesec
    end if

    entertime = thehour - 3 & ":" & themin & ":" & thesec & " PM"
    thedate = Date()
    end if

    if ((thetime1 = "PM") and (thehour = 3)) then
    lenthemin = len(themin)
    if lenthemin = 1 then
    themin = "0" & themin
    end if
    lenthesec = len(thesec)
    if lenthesec = 1 then
    thesec = "0" & thesec
    end if

    entertime = ((thehour + 12) - 3) & ":" & themin & ":" & thesec & " PM"
    thedate = Date()
    end if

    if ((thetime1 = "PM") and (thehour < 3)) then
    lenthemin = len(themin)
    if lenthemin = 1 then
    themin = "0" & themin
    end if
    lenthesec = len(thesec)
    if lenthesec = 1 then
    thesec = "0" & thesec
    end if

    entertime = ((thehour + 12) - 3) & ":" & themin & ":" & thesec & " AM"
    thedate = Date()
    end if



    if ((thetime1 = "AM") and (thehour >= 4)) then
    lenthemin = len(themin)
    if lenthemin = 1 then
    themin = "0" & themin
    end if
    lenthesec = len(thesec)
    if lenthesec = 1 then
    thesec = "0" & thesec
    end if

    entertime = thehour - 3 & ":" & themin & ":" & thesec & " AM"
    thedate = Date()
    end if

    if ((thetime1 = "AM") and (thehour = 3)) then
    lenthemin = len(themin)
    if lenthemin = 1 then
    themin = "0" & themin
    end if
    lenthesec = len(thesec)
    if lenthesec = 1 then
    thesec = "0" & thesec
    end if

    entertime = ((thehour + 12) - 3) & ":" & themin & ":" & thesec & " AM"
    thedate = Date()
    end if

    if ((thetime1 = "AM") and (thehour < 3)) then
    lenthemin = len(themin)
    if lenthemin = 1 then
    themin = "0" & themin
    end if
    lenthesec = len(thesec)
    if lenthesec = 1 then
    thesec = "0" & thesec
    end if

    entertime = ((thehour + 12) - 3) & ":" & themin & ":" & thesec & " PM"
    thedate = Date - 1
    end if

Posting Permissions

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



Click Here to Expand Forum to Full Width