473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

ADODB.Record - Fields("RESOURCE_LASTWRITETIME")

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:

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

Public Sub CheckAppCurrency()

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

Set R = New ADODB.Record
R.Open "", _
"URL=" & AppLocation, , _
adOpenIfExists Or adCreateCollection
With R
S = R.Fields("RESOURCE_LASTWRITETIME").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 1933
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_INFORMATION
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 GetTimeZoneInformation _
Lib "kernel32" _
(lpTimeZoneInformation As TIME_ZONE_INFORMATION) _
As Long
Public Function CompareDateTimes(ByVal dtZulu As Date, ByVal dtLocal As
Date) As Long
' returns difference in seconds
Dim TZI As TIME_ZONE_INFORMATION

GetTimeZoneInformation TZI

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

CompareDateTimes = 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_INFORMATION
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 GetTimeZoneInformation _
Lib "kernel32" _
(lpTimeZoneInformation As TIME_ZONE_INFORMATION) _
As Long
Public Function CompareDateTimes(ByVal dtZulu As Date, ByVal dtLocal As
Date) As Long
' returns difference in seconds
Dim TZI As TIME_ZONE_INFORMATION

GetTimeZoneInformation TZI

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

CompareDateTimes = 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_INVALID As Long = &HFFFFFFFF
Const TIME_ZONE_ID_UNKNOWN As Long = &H0
Const TIME_ZONE_ID_STANDARD As Long = &H1
Const TIME_ZONE_ID_DAYLIGHT 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_INFORMATION
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 GetTimeZoneInformation _
Lib "kernel32" _
(lpTimeZoneInformation As TIME_ZONE_INFORMATION) _
As Long

Public Function CompareDateTimes( _
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_INFORMATION

Select Case GetTimeZoneInformation(TZI)
Case TIME_ZONE_ID_UNKNOWN
If TZI.Bias > Bias Then
Bias = TZI.Bias
End If
Case TIME_ZONE_ID_STANDARD
Bias = TZI.Bias
Case TIME_ZONE_ID_DAYLIGHT
Bias = TZI.DaylightBias
End Select
dtZulu = DateAdd("n", Bias, dtZulu)
CompareDateTimes = 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
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.