zhenxin 0 Posted January 26, 2008 Report Share Posted January 26, 2008 Public Function TimeConverter(ByVal time As Integer) As String Dim times As String Dim hour As Double = Date.Now.Hour Dim h As String = " " Dim min As Double = Date.Now.Minute Dim m As String = " " Dim sec As Double = Date.Now.Second Dim s As String = " " Dim ap As String hour += time If (hour < 10) And (hour > 0) Then hour = "0" + hour h = hour ElseIf (hour < 0) Then hour = hour + 12 h = hour Else h = hour End If If (min < 10) Then m = "0" + min Else m = min End If If (sec < 10) Then s = "0" + sec Else s = sec End If If (h <= 11) Then ap = "AM" Else ap = "PM" End If If (h > 12) Then h -= 12 End If times = h + ":" + m + ":" + s + " " + ap Return times End FunctionCan i know where is the place which the server will return the times for different countries like CHina and Malaysia? Quote Link to post Share on other sites
Synook 47 Posted January 27, 2008 Report Share Posted January 27, 2008 You can't get the server to immediately return those values (it doesn't know) you will need to add the time zone difference between them and add hours / minutes accordingly. For instance, if your server was on the East coast of the USA (GMT - 5) and you wanted the time for China (GMT + 8) then you would do Dim hour As Double = Date.Now.Hour + 13 Quote Link to post Share on other sites
zhenxin 0 Posted January 28, 2008 Author Report Share Posted January 28, 2008 You can't get the server to immediately return those values (it doesn't know) you will need to add the time zone difference between them and add hours / minutes accordingly. For instance, if your server was on the East coast of the USA (GMT - 5) and you wanted the time for China (GMT + 8) then you would doDim hour As Double = Date.Now.Hour + 13 But i can get various countries' time back in another website when i add web reference to it. Quote Link to post Share on other sites
Synook 47 Posted January 28, 2008 Report Share Posted January 28, 2008 What do you mean by "web reference"? Quote Link to post Share on other sites
zhenxin 0 Posted January 29, 2008 Author Report Share Posted January 29, 2008 What do you mean by "web reference"?That means. when i add web reference to another .aspx page. that page can consume the webservice that i created. Quote Link to post Share on other sites
Synook 47 Posted January 29, 2008 Report Share Posted January 29, 2008 One server cannot find out the time on another server.Hang on what web service are you creating? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.