View Single Post
  #8  
Old August 5th 08, 08:22 AM posted to microsoft.public.outlook.program_vba
masani paresh[_2_]
external usenet poster
 
Posts: 84
Default Handle different international time zones for Item.Start and I

Hi Ken,
I have written following steps to get the UTC value of current time by
reading reg keys. But when it executes the set oShell =
CreateObject("WScript.Shell") statement, it show the dialog box for
confirming some installation. I have to click yes then it will proceed and
works fine. Could you tell me how to make this statement to work silently.

startTime = Item.Start
endTime = Item.End
set oShell = CreateObject("WScript.Shell")
atb = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\" &_
"Control\TimeZoneInformation\ActiveTimeBias"
offsetMin = oShell.RegRead(atb)
startTime = dateadd("n", offsetMin, startTime)
endTime = dateadd("n", offsetMin, endTime)

startTime = Format(startTime,"yyyy-mm-dd" & "T" & "hh:mm:ss" & "Z")
endTime = Format(endTime,"yyyy-mm-dd" & "T" & "hh:mm:ss" & "Z")
MsgBox startTime & vbcrlf & endTime

Thanks,
Paresh

"Ken Slovak - [MVP - Outlook]" wrote:

You'd need to use WSH (Windows Scripting) to read the registry to get those
settings.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"masani paresh" wrote in message
...
Hi Friends,

My mail goal is to get the UTC time for local zone. I am facing problems
in
handling internation time zones in VBScript for Item.Start and Item.End.
Could any one tell me in brief/code to handle different international time
zones. I thought of the below solution:

1. Get the UTC time
2. Get the time difference with local zone
3. Add it to UTC.

Is there any ways to do this in VBScript?

Thanks in Advance,
Megha



Ads