Solved

Dates and Times in NT

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

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

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

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

830 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