SunQuest
           Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old March 8th, 2001, 01:13 AM
nicbjo nicbjo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 1 nicbjo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to nicbjo
Angry

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

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > AspTear and different timezones


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway