Function RSSTime(strTime)
od = strToDate(strTime)
set oShell = CreateObject("WScript.Shell")
atb = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias"
offsetMin = oShell.RegRead(atb)
RSSTime = dateadd("n", offsetMin, od)
End FunctionOriginally posted by Shaggy1) a GMT time can not be a DST time, it is not possible
Yeah, I was perfectly happy to leave them as GMT but a site in America that's pulling in one of my feeds converts the timestamps to their own local time so anything with a GMT timezone that's actually DST is being converted to an hour in the future and they're not displaying it. Looking ahead, I can see this being a problem on a site I've got lined up for next month which is expected to have a large international audience.
The date and time is being pulled from my database - where it's stored the same way we store dates here (yyyymmddhhmmss) - and then being converted to a valid date/time string so I've no way of telling if the time for each record in the database is GMT or DST.
Originally posted by HuwR 1) a GMT time can not be a DST time, it is not possibleThat's the problem. At the moment, all the times in my feed have GMT appended to them which is fine for anything posted last week but anything posted this week should have +0100 instead of GMT as the timezone because, as you say, DST is not GMT. The times are inserted into the database based on the current server time (GMT last week, DST this week) so the problem is arising when I pull them and just throw GMT on the end; this site checks the timezone in the timestamp and adjusts it accordingly to display it in their local time.
function timestamp(str)
if isnull(str) or len(str)=0 then exit function
timestamp=mid(str,7,2)&"/"&mid(str,5,2)&"/"&left(str,4)
if isdate(timestamp) then
timestamp=cdate(timestamp)
timestamp=weekdayname(weekday(timestamp),true)&", "&day(timestamp)&" "&monthname(month(timestamp),true)&" "&year(timestamp)&" "&mid(str,9,2)&":"&mid(str,11,2)&":"&right(str,2)&" GMT"
else
timestamp=""
end if
end function"... the period beginning at one o'clock, Greenwich mean time, in the morning of the last Sunday in March and ending at one o'clock, Greenwich mean time, in the morning of the last Sunday in October."With SiSL's script, I won't need to do this for any sites I build in the future but would still need the option just in case I'm working on a server that won't allow me to read the registry. I found this PERL script this morning so I'm going to take a whirl at translating that; looks straightforward enough even though I don't "speak" PERL.
function timestamp(str)
dim intYear,strTimezone
if isnull(str) or len(str)=0 then exit function
timestamp=mid(str,7,2)&"/"&mid(str,5,2)&"/"&left(str,4)&" "&mid(str,9,2)&":"&mid(str,11,2)&":"&right(str,2)
if isdate(timestamp) then
timestamp=cdate(timestamp)
intYear=year(timestamp)
if timestamp>=cdate((31-(5*intYear/4+4)mod 7)&"/03/"&intYear&" 01:00:00") and timestamp<=cdate((31-(5*intYear/4+1)mod 7)&"/10/"&intYear&" 01:00:00") then strTimezone="+0100" else strTimezone="GMT"
timestamp=weekdayname(weekday(timestamp),true)&", "&day(timestamp)&" "&monthname(month(timestamp),true)&" "&intYear&" "&doubledigit(hour(timestamp))&":"&doubledigit(minute(timestamp))&":"&doubledigit(second(timestamp))&" "&strTimezone
else
timestamp=""
end if
end functionOriginally posted by SiSL As long as IIS run with System users, I think you'd able to access that key since it is used by most system services in Windows.I'll keep that in mind. It's rare these days that I'm not working on my own server but it's good to have both options to fall back on, just in case