|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Hi all,
I have a problem regarding different timezones. I am using the AspTear component to "grab" news headlines from a server in Sweden (I live in Sweden), but my website is located on a server in the U.S. somewhere, I think (websamba.com). The problem is that the time in Sweden is 6 hours ahead compared with the timezone that my server is in, and therefore the displayed news headlines on my page is 6 hours late! Example: U.S. timeformat: 2/23/01 4:31:29 AM Swedish timeformat: 2001-02-23 10:31:29 Is there a way to "fool" the WebSamba webserver to think it is a different time (I have tried DateAdd and experimented with SetLocale() but with no luck), or is there a different way to approach the problem, or is there a way at all? This is from the .asp-file (run.asp) that grabs the page when it is accessed or refreshed: Response.Buffer = True Set xobj = server.CreateObject("SOFTWING.ASPtear") Response.ContentType = "text/html" strRetval = xobj.Retrieve("http://www.aftonbladet.se/vss/telegram/nyhetsbevakaren/0,1195,_SPT__,00.html", 2, "", "", "") I choose what I want to display on my page from strRetval with: lenRubrik1 = Len(Mid(strRetval, (Instr(1, strRetval, "/vss/telegram/0,", 1)), (Instr(strRetval, "</HTML>") + 0))) lenRubrik2 = Len(Mid(strRetval, (Instr(9, strRetval, "</FONT>)", 1)), (Instr(strRetval, "</HTML>") + 0))) Rubrik = Mid(strRetval, (Instr(1, strRetval, "/vss/telegram/0,", 1)), (lenRubrik1-lenRubrik2)) Then I update my database and returns to the "display-page" (index_info.asp): ConnString = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" ConnString = ConnString & Server.MapPath("../db/collect.mdb") Set Connection = Server.CreateObject("ADODB.Connection") Connection.Open ConnString SQLStmt = "UPDATE collect SET " SQLStmt = SQLStmt & "Rubrik= '"& Rubrik &"'," SQLStmt = SQLStmt & "PointOfTime= Now " SET RS = Connection.Execute(SQLStmt) Connection.Close Application.Lock Application("PointOfTime") = Now Application.UnLock End IF Response.Redirect("../index_info.asp") I also think that it is in the "grabbing moment" that I must set the time somehow. Proceeding with index_info.asp: <% ConnString = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" ConnString = ConnString & Server.MapPath("db/collect.mdb") Set Connection = Server.CreateObject("ADODB.Connection") Connection.Open ConnString SQLStmt = "Select * From Collect" SET RS = Connection.Execute(SQLStmt) If DateDiff("n", Application("PointOfTime"), Now) >=1 OR DateDiff("n", RS("PointOfTime"), Now) >=1 Then Response.Redirect("collect/run.asp") else %> <TABLE border=0 cellPadding=0 cellSpacing=0 height="100%" width="100%"> <tr> <td width="50%" align="center" valign="middle"><font face="Verdana" size="1"><a href="http://www.aftonbladet.se<%= RS("Rubrik") %></FONT>)</font></td> <!-- Yes, the code looks a little weird here, but my grabbed line fits in perfectly! --> <td width="50%" align="center" valign="middle"><font face="Verdana" size="1">Sport headlines from </font><a href="http://www.aftonbladet.se" target="_blank"><img border="0" src="collect/ablogga.jpg" align="absmiddle"></a></td> </tr> </table> Any ideas? Thanks for your help! Best regards Niclas Bjorkstrom Sweden |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > AspTear and different timezones |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|