Solved

Dates and Times in NT

Posted on 2000-04-10
3
262 Views
Last Modified: 2013-12-28
What timezone is used when computing
dates and times in DATE, DBTYPE_DATE,
DBTYPE_DBDATE, DBTYPE_DBTIME, FILETIME
and other microsoft defined date and
time formats.

Is it the time relative to the machines
local time, GMT time, or something else
again.

Microsoft's documentation would suggest
that they've never heard of timezones
and this leaves me bemused..

Thanks, Ian
0
Comment
Question by:ijdavis
3 Comments
 
LVL 4

Expert Comment

by:gcs001
ID: 2702401
The timezone you set for your computer is sometimes used in certain programs that use International Settings.  This can affect the way your computer displays the date and time.

In normal circumstances a program will use the system date and time it has been set to without regard to the timezone (International Settings) you have selected.

I have no idea which programs use the timezone setting - but I guess some web-sites would use it to probably determine the exact time a web page was accessed or something like that.
0
 
LVL 1

Accepted Solution

by:
Assafgo earned 50 total points
ID: 2703509
Ian, notice that microsoft sometimes makes differences between GetSystemTime..., which is in UTC - without the time zone and functions as
GetLocalTime, which actually take the afor-mentioned functions and add the Timezone difference.
If not mentioned, microsoft works with 'system' time, but you can add yourself the timezone with the function
GetTimeZoneInformation which translates between the two times.
if you want to be sure, the function GetSystemTimeAsFileTime always gets FILETIME as system time
and you have also conversion functions
for switching such as
FileTimeToLocalFileTime,
FileTimeToSystemTime and
LocalFileTimeToFileTime.

You ca also use the SYSTEMTIME structure with either GetSystemTime or GetLocalTime and then you can be sure what you get.
then use SystemTimeToFileTime for conversion
0
 

Author Comment

by:ijdavis
ID: 2706369
Thanks a million for giving me the
means to answer the question asked.
Your answer was several order of
magnitude clearer than microsofts
explanations..

I'm going to assume that what is
true for DBTYPE_FILETIME also applied
for DBTYPE_DATE, DBTYPE_DBTIME,
DBTYPE_DBDATE and DBTYPE_DBTIMESTAMP.

Ian.
0

Featured Post

Will my email signature work in Office 365?

You've built an email signature using raw HTML code in Office 365, but you can't review how it looks with Transport Rules. So you have to test it over and over again before it can be used. Isn't this a bit of a waste of your time? Wouldn't a WYSIWYG editor make it a lot easier?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now