|
-
Nov 22nd, 2002, 01:02 AM
#1
Thread Starter
New Member
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,
-
Nov 22nd, 2002, 01:45 PM
#2
Why dont you just use the dateadd function:
Code:
DateAdd(DateInterval.Hour, -3, thetime)
-
Nov 22nd, 2002, 03:23 PM
#3
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|