|
|
Hi all,
How am I going to change the given time to given time zone and get the converted time in string format?
let's say.
gmt = +06:30 and giving time dt is in different time zone
following function that I wrote is totally wrong. it is not giving me the correct time string in the given time zone.
CString convertTime(int gmt,COleDateTime dt)
{
COleDateTime formatedDateTime;
COleDateTimeSpan timeSpan(0,gmt,0,0);
formatedDateTime = dt + timeSpan;
dtStr = formatedDateTime.Format("%Y-%m-%d %H:%M:%S");
return dtStr;
}
Thank you so much for your help.
|
|
|
|
|
Have you seen any of the time-related functions:
localtime()
gmtime()
asctime()
LocalFileTimeToFileTime()
SystemTimeToTzSpecificLocalTime()
TzSpecificLocalTimeToSystemTime()
GetTimeFormat()
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
What is the value of gmt ? In your example, it cannot work, because in order to add 6:30 you will have to do the following:
COleDateTimeSpan timeSpan(0,6,30,0);
which cannot be achieved with
COleDateTimeSpan timeSpan(0,gmt,0,0);
Another solution:
transform gmt from an int into a COleDateTime, and do not use any COleDateTimeSpan but only COleDateTime .
~RaGE();
|
|
|
|
|
Thank you David and Rage for your replies.
I look at gmtime() and it is seems like what I need to use. But dont' really know how to comvert COleDateTime dt to given gmt time.
here what I have..
CString converttime(CString gmt,COleDateTime dt)
{
//let's say gmt="+03:30" and dt = aug 25,2005 6:58pm
//the converted time should be dt3 = aug 26,2005 3:28 am
int hr,min;
CString hrStr,minStr, sign;
int pos = 2;
sign = gmt.GetAt(0);
minStr = gmt.Right(gmt.GetLength()- (pos+1));
hrStr = gmt.Left(pos);
hr = atoi(hrStr);
min = atoi(minStr);
COleDateTime dt2(0,0,0,hr,min,0);
COleDateTime dtDiff = dt+dt2;
}
I got it wrong again.. how can I convert it the given time to the given GMT time that has + and - time?
Thank you so much for your help.
-- modifed at 18:54 Thursday 25th August, 2005
|
|
|
|
|
Hello,
I was wondering is there a way that you can make multithreaded pipe server inside WDM device driver to take out to a user-mode aplicaton some variables. Whenever I call DeviceIoControl with the specified control code I get an error. I don't know how to fix the error, but I figured that maybe there is another way of taking out variables out of a device driver without DeviceIoControl (pipes for example ).
Please reply
gabby
|
|
|
|
|
Hi,
does someone use Eclipse/CDT? Would be interesting to know if you can use Eclipse to write MFC applications, I am using VC6 currently.
Thanks!
|
|
|
|
|
I use Eclipse v3.0 for AUIML and Java development. I do not know if an MFC project exists. You might check here.
Why do you not want to use VC6?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
DavidCrow wrote:
Why do you not want to use VC6?
I am using VC6 and C/C++ for years and interested in Eclipse as an alternative. Diversity won't harm. With a a 7-8 years old product like VC6 there is a good chance for other IDEs to catch up, especially an open source project like Eclipse with many big guys on the block pushing behind it. Would be interesting for me to hear what developers who used Eclipse think about it.
|
|
|
|
|
I know Eclipse has support for some open-source GUI frameworks, like FLTK, but I would be very surprised if there were any support for MFC.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Hmm, I have VC6 and Eclipse installed on my development PC. VC6 comes with MFC headers and libraries, it should be possible to configure Eclipse/CDT to use tools from the Microsoft Visual Studio directory (compiler, link, make, debugger)? If it's possible, this would give you more or less the opportunity to migrate towards Eclipse and still be able using "good old" MFC.
Just a guess into the blue sky....
|
|
|
|
|
Moak wrote:
I am using VC6 and C/C++ for years and interested in Eclipse as an alternative. Diversity won't harm.
I agree. I thought you wanted to use something else because of an error in VC6 or maybe Eclipse had some whiz-bang feature. By all means learn new tools.
Moak wrote:
Would be interesting for me to hear what developers who used Eclipse think about it.
From just the little bit that I've done with it, my impression is that it is slow. I haven't quite got the folder structure figured out to where I am comfortable with it. Once a project has been downloaded and unzipped, you have to copy a bunch of folders into the Eclipse hierarchy. One good thing I've noticed about it is that the installation is very simple. If you mess up, it's real easy to start over because other files have not been scattered all over and the registry has not been littered with tons of settings.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
DavidCrow wrote:
because of an error in VC6 or maybe Eclipse had some whiz-bang feature
I am a little bit curious about the refactoring support and which plugins the development community produces. Whiz-bang... would be nice to have for example a 'windiff' tool which automatically compares a source file with latest stable version, on click of a button.
|
|
|
|
|
hi,
i created coons surface in MFC using OpenGL by using 4 curves, but how to create the coons surface if i have more than that,
means if i have 3 V direction curve 4 u direction curve
help me
ganesh
|
|
|
|
|
Hi,
Does anyone know how to scroll to a particular position in a CHtmlView derived object? Ideally I would like the user to be placed in exactly the same position on the page when they hit the back button. I know how to hightlight the element/item on the page and using ScrollIntoView() have it be on top of the page, but the users want it to be exactly in the same position it was before (i.e. in the middle of the page.)
Any help or suggestion is greatly appreciated.
Thanks,
Al
|
|
|
|
|
Hi!
I've got a problem with the fprintf function. I want to write a character into a file by giving the function the decimal value of the character.
Here's some code to explain it:
char * p;
CString csHex = "0A"; // hex value of the character
int iValue = strtol(csHex,&p,16); // int value of the character
char c = iValue;
fprintf(fFile,"%c",c);
Sofar it's working quiet good, but there seems to be a problem with 10 as int value (= 0x0A). Instead of only writing the character for 0x0A to the file it also adds the character for 0x0D before 0x0A to the file.
Can anyone tell me, how i can only add the character for 0x0A, without 0x0D?
Thankx a lot and greets from germany. Mike.
|
|
|
|
|
What is the second parameter to fopen() ?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Se above. And remember: Text mode is default (Default can be changed, though).
|
|
|
|
|
kakan wrote:
Se above.
Above what? What are you referring to?
kakan wrote:
Text mode is default (Default can be changed, though).
I'm full aware of this.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I tried to complete your answer to the original question. You didn't mention this in your answer.
It wasn't my intention to offend your knowledge in any way. Sorry if you got that impression.
I should have replied to the original question. I'll do better next time.
Regards
kakan
|
|
|
|
|
kakan wrote:
I tried to complete your answer to the original question. You didn't mention this in your answer.
I did not give him the answer on purpose. My intent was to lead him to it rather than just outright give it to him. It's that old "Give a man a fish..." adage.
kakan wrote:
It wasn't my intention to offend your knowledge in any way. Sorry if you got that impression.
No offense taken.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
fOutput = fopen(csOutputFile,"w");
How can i open the file in binary mode?
-- modified at 1:32 Friday 26th August, 2005
I've found it! Thanks a lot.
|
|
|
|
|
You have to open your file in binary mode and not in text mode.
|
|
|
|
|
I've got it. Thanks a lot.
|
|
|
|
|
hi! Can anyone suggest a good project topic for DCOM, distributed processing system?
|
|
|
|