Solved

Dates and Times in NT

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

Don't lose your head updating email signatures!

Do your end users still have the wrong email signature? Do email signature updates bore you or fill you with a sense of dread? You can make this a whole lot easier on yourself by trusting an Exclaimer email signature management solution. Over 50 million users do...so should you!

Join & Write a Comment

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 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

16 Experts available now in Live!

Get 1:1 Help Now