The information in this article applies to:
SYMPTOMSWhen using the SetColumns method to retrieve dates or times from tasks, the times may not accurately reflect what is stored in the task. CAUSEWith the exception of tasks, all dates in Outlook are stored in Coordinated Universal Time (UTC), also known as Greenwich Mean Time (GMT). However, tasks store dates in local time. The SetColumns method always converts the retrieved time into local time, therefore causing the times to be offset. WORKAROUNDUse either of the following methods to work around this behavior. Method 1: Do Not Use SetColumnsDo not use the SetColumns method to retrieve dates with tasks. In most cases this will adversely affect your solution's performance.Method 2: Retrieve and Use an OffSetNOTE: If you are using Visual Basic Scripting Edition (VBScript), you cannot access the system registry and this workaround does not apply.If you are using Visual Basic or Visual Basic for Applications, programmatically get the local time zone information from the computer running your application. This information is stored in the following location in the registry: HKEY_Local_Machine\SYSTEM\CurrentControlSet\Control\TimeZoneInformationThe Bias value specifies the current bias, in minutes, for local time translation on the computer. The bias is the difference, in minutes, between local time and UTC. Use this value to correct the time retrieved using the SetColumns method. STATUSMicrosoft has confirmed this to be a problem in Microsoft Outlook 2000. MORE INFORMATION
The Date type is implemented as a floating-point value, measuring days from midnight, December 30, 1899. To interpret the time portion, take the absolute value of the fractional part of the number. Since the bias is measured in minutes however, you must divide the bias by the number of minutes in a day (1440) in order to perform the conversion. The formula is: For example, the Date value of a task to be started February 14, 1999 (UTC) should be 36205.0. However, if your application is run on a computer in New York, the Date value (local time) will be 36204.7916667 (February 13, 1999 7:00 P.M.). To perform the conversion, find the computer's bias from the registry, which is 0x0000012c (300 minutes). Using this in the formula, we have: For more information about using Visual Basic to retrieve values from the registry, please see the following article in the Microsoft Knowledge Base: Q1456796 HOWTO: Use the Registry API to Save and Retrieve Setting Steps to Reproduce the Problem:Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft Support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:http://www.microsoft.com/support/supportnet/overview/overview.asp
REFERENCES
For additional information about available resources and answers
to commonly asked questions about Microsoft Outlook 2000 solutions,
please see the following article in the Microsoft Knowledge Base: Q146636 OL2000: Questions About Custom Forms and Outlook Solutions Additional query words: OL2K OutSol OutSol2000 vbscript
Keywords : kbdta |
Last Reviewed: November 13, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |