Click here to Skip to main content
15,928,109 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Adding timezone to a COleDateTime object Pin
David Crow20-Feb-04 6:52
David Crow20-Feb-04 6:52 
GeneralRe: Adding timezone to a COleDateTime object Pin
DimpleSurana22-Feb-04 18:19
DimpleSurana22-Feb-04 18:19 
GeneralRe: Adding timezone to a COleDateTime object Pin
DimpleSurana22-Feb-04 18:47
DimpleSurana22-Feb-04 18:47 
GeneralRe: Adding timezone to a COleDateTime object Pin
David Crow20-Feb-04 3:33
David Crow20-Feb-04 3:33 
GeneralRe: Adding timezone to a COleDateTime object Pin
DimpleSurana20-Feb-04 3:39
DimpleSurana20-Feb-04 3:39 
GeneralRe: Adding timezone to a COleDateTime object Pin
David Crow20-Feb-04 3:48
David Crow20-Feb-04 3:48 
GeneralRe: Adding timezone to a COleDateTime object Pin
DimpleSurana20-Feb-04 3:55
DimpleSurana20-Feb-04 3:55 
GeneralRe: Adding timezone to a COleDateTime object Pin
David Crow20-Feb-04 5:48
David Crow20-Feb-04 5:48 
DimpleSurana wrote:
How do i use that value to update my COleDateTime object

You don't (or maybe the id you have from Java's TimeZone class is a requirement, in which case I'm not sure of a solution). The Bias member of the TIME_ZONE_INFORMATION structure tells you how far from UTC you are and in what direction. Here is one solution:

TIME_ZONE_INFORMATION tza;
COleDateTime today = COleDateTime::GetCurrentTime();
GetTimeZoneInformation(&tza);
cout << "The local time is " << (LPCTSTR) today.Format("%H:%M:%S") << endl;
today.m_dt = today.m_dt + (tza.Bias / 1440.0);
cout << "UTC time is " << (LPCTSTR) today.Format("%H:%M:%S") << endl;



"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
GeneralProblems with the new HTML Editing classes in MFC7 Pin
panzerdivisionmarkus19-Feb-04 20:37
panzerdivisionmarkus19-Feb-04 20:37 
Generaltime in ascii Pin
styve19-Feb-04 20:35
styve19-Feb-04 20:35 
GeneralRe: time in ascii Pin
Maxwell Chen19-Feb-04 20:46
Maxwell Chen19-Feb-04 20:46 
GeneralRe: time in ascii Pin
styve19-Feb-04 21:09
styve19-Feb-04 21:09 
GeneralRe: time in ascii Pin
Maxwell Chen19-Feb-04 21:20
Maxwell Chen19-Feb-04 21:20 
GeneralRe: time in ascii Pin
styve20-Feb-04 2:20
styve20-Feb-04 2:20 
GeneralRe: time in ascii Pin
Prakash Nadar19-Feb-04 21:21
Prakash Nadar19-Feb-04 21:21 
GeneralRe: time in ascii Pin
styve20-Feb-04 2:24
styve20-Feb-04 2:24 
GeneralRe: time in ascii Pin
David Crow20-Feb-04 3:44
David Crow20-Feb-04 3:44 
GeneralMs WebBrowser GetSource! Pin
Alex H 198319-Feb-04 20:16
Alex H 198319-Feb-04 20:16 
GeneralTriggers in windows application ^_^!!! Pin
solostar***19-Feb-04 20:11
solostar***19-Feb-04 20:11 
Questionvisual c++ funny or its a bug? Pin
19-Feb-04 18:39
suss19-Feb-04 18:39 
AnswerRe: visual c++ funny or its a bug? Pin
Alex H 198319-Feb-04 20:49
Alex H 198319-Feb-04 20:49 
AnswerRe: visual c++ funny or its a bug? [Edited] Pin
Maxwell Chen19-Feb-04 20:52
Maxwell Chen19-Feb-04 20:52 
GeneralRe: visual c++ funny or its a bug? Pin
DimpleSurana19-Feb-04 20:59
DimpleSurana19-Feb-04 20:59 
GeneralRe: visual c++ funny or its a bug? [Edited] Pin
Abin19-Feb-04 21:23
Abin19-Feb-04 21:23 
GeneralRe: visual c++ funny or its a bug? [Edited] Pin
Sebastian Schneider19-Feb-04 21:46
Sebastian Schneider19-Feb-04 21:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.