473,728 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ADODB.Record - Fields("RESOURC E_LASTWRITETIME ")

ADODB.Record - Fields("RESOURC E_LASTWRITETIME ")

Can you confirm that this field returns a datetime as a GMT (UTC - zulu)
value?

I'm guessing I have to go to API to convert safely regardless of time zone
to which the computer is defaulted?

partial code is:

Const AppLocation As String = "http://some site and file"

Public Sub CheckAppCurrenc y()

Dim R As ADODB.Record
Dim S As Date
Dim L As Date

Set R = New ADODB.Record
R.Open "", _
"URL=" & AppLocation, , _
adOpenIfExists Or adCreateCollect ion
With R
S = R.Fields("RESOU RCE_LASTWRITETI ME").Value
.Close
End With

...

S seems to be GMT.

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #1
4 1964
Lyle Fairfield <Mi************ @Invalid.Com> wrote in
news:Xn******** ***********@130 .133.1.4:
I'm guessing I have to go to API to convert safely regardless of time
zone to which the computer is defaulted?


Well, this was not so tough; I thought it would require a lot of
conversions from VBA datetimes to SystemTimes, but one can just use the
Time Zone Information Bias:

Option Compare Database
Option Explicit

Private Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type

Private Type TIME_ZONE_INFOR MATION
Bias As Long
StandardName(32 ) As Integer
StandardDate As SYSTEMTIME
StandardBias As Long
DaylightName(32 ) As Integer
DaylightDate As SYSTEMTIME
DaylightBias As Long
End Type

Private Declare Function GetTimeZoneInfo rmation _
Lib "kernel32" _
(lpTimeZoneInfo rmation As TIME_ZONE_INFOR MATION) _
As Long
Public Function CompareDateTime s(ByVal dtZulu As Date, ByVal dtLocal As
Date) As Long
' returns difference in seconds
Dim TZI As TIME_ZONE_INFOR MATION

GetTimeZoneInfo rmation TZI

dtZulu = DateAdd("n", TZI.Bias, dtZulu)

CompareDateTime s = DateDiff("s", dtZulu, dtLocal)

End Function


--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #2
Don't you want to know that it is, in fact, daylight savings time when the
code is run?
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies

This posting is provided "AS IS" with
no warranties, and confers no rights.
"Lyle Fairfield" <Mi************ @Invalid.Com> wrote in message
news:Xn******** ***********@130 .133.1.4...
Lyle Fairfield <Mi************ @Invalid.Com> wrote in
news:Xn******** ***********@130 .133.1.4:
I'm guessing I have to go to API to convert safely regardless of time
zone to which the computer is defaulted?


Well, this was not so tough; I thought it would require a lot of
conversions from VBA datetimes to SystemTimes, but one can just use the
Time Zone Information Bias:

Option Compare Database
Option Explicit

Private Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type

Private Type TIME_ZONE_INFOR MATION
Bias As Long
StandardName(32 ) As Integer
StandardDate As SYSTEMTIME
StandardBias As Long
DaylightName(32 ) As Integer
DaylightDate As SYSTEMTIME
DaylightBias As Long
End Type

Private Declare Function GetTimeZoneInfo rmation _
Lib "kernel32" _
(lpTimeZoneInfo rmation As TIME_ZONE_INFOR MATION) _
As Long
Public Function CompareDateTime s(ByVal dtZulu As Date, ByVal dtLocal As
Date) As Long
' returns difference in seconds
Dim TZI As TIME_ZONE_INFOR MATION

GetTimeZoneInfo rmation TZI

dtZulu = DateAdd("n", TZI.Bias, dtZulu)

CompareDateTime s = DateDiff("s", dtZulu, dtLocal)

End Function


--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)

Nov 12 '05 #3
"Michael \(michka\) Kaplan [MS]" <mi*****@online .microsoft.com> wrote in
news:40******** @news.microsoft .com:
Don't you want to know that it is, in fact, daylight savings time when the
code is run?


Not this time.

But if you have a simple procedure for doing so, I'd be happy to add it to my
library, and to say, "Thanks".

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #4
Lyle Fairfield <Mi************ @Invalid.Com> wrote in
news:Xn******** ***********@130 .133.1.4:
"Michael \(michka\) Kaplan [MS]" <mi*****@online .microsoft.com> wrote in
news:40******** @news.microsoft .com:
Don't you want to know that it is, in fact, daylight savings time when
the code is run?


Not this time.

But if you have a simple procedure for doing so, I'd be happy to add it
to my library, and to say, "Thanks".

OK ... upon further review ... I should allow for Daylight Saving Time,
although I am comparing the dates of two files and am not concerned in this
particular instance with any difference less than a few hours.

So ...

Const TIME_ZONE_ID_IN VALID As Long = &HFFFFFFFF
Const TIME_ZONE_ID_UN KNOWN As Long = &H0
Const TIME_ZONE_ID_ST ANDARD As Long = &H1
Const TIME_ZONE_ID_DA YLIGHT As Long = &H2

Private Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type

Private Type TIME_ZONE_INFOR MATION
Bias As Long
StandardName(32 ) As Integer
StandardDate As SYSTEMTIME
StandardBias As Long
DaylightName(32 ) As Integer
DaylightDate As SYSTEMTIME
DaylightBias As Long
End Type

Private Declare Function GetTimeZoneInfo rmation _
Lib "kernel32" _
(lpTimeZoneInfo rmation As TIME_ZONE_INFOR MATION) _
As Long

Public Function CompareDateTime s( _
ByVal dtZulu As Date, _
ByVal dtLocal As Date, _
Optional Bias As Long = 300) As Long
' returns difference in seconds
' defaults to Eastern North America Time ... Tronna

Dim TZI As TIME_ZONE_INFOR MATION

Select Case GetTimeZoneInfo rmation(TZI)
Case TIME_ZONE_ID_UN KNOWN
If TZI.Bias > Bias Then
Bias = TZI.Bias
End If
Case TIME_ZONE_ID_ST ANDARD
Bias = TZI.Bias
Case TIME_ZONE_ID_DA YLIGHT
Bias = TZI.DaylightBia s
End Select
dtZulu = DateAdd("n", Bias, dtZulu)
CompareDateTime s = DateDiff("s", dtLocal, dtZulu)

End Function

I sort my declarations alphabetically so I may have left some pertinent
declaration out, or included a redundancy.
--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
411
by: Lyle Fairfield | last post by:
ADODB.Record - Fields("RESOURCE_LASTWRITETIME") Can you confirm that this field returns a datetime as a GMT (UTC - zulu) value? I'm guessing I have to go to API to convert safely regardless of time zone to which the computer is defaulted? partial code is:
0
9277
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9198
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9135
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8133
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6013
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4524
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4793
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3236
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.