Solved

Dates and Times in NT

Posted on 2000-04-10
3
272 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

This is an article about Leadership and accepting and adapting to new challenges. It focuses mostly on upgrading to Windows 10.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
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.

773 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