zhenxin Posted January 26, 2008 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? Link to comment Share on other sites More sharing options...
Synook Posted January 27, 2008 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 Link to comment Share on other sites More sharing options...
zhenxin Posted January 28, 2008 Author 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. Link to comment Share on other sites More sharing options...
Synook Posted January 28, 2008 Share Posted January 28, 2008 What do you mean by "web reference"? Link to comment Share on other sites More sharing options...
zhenxin Posted January 29, 2008 Author 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. Link to comment Share on other sites More sharing options...
Synook Posted January 29, 2008 Share Posted January 29, 2008 One server cannot find out the time on another server.Hang on what web service are you creating? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.