CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2004
    Posts
    16

    Simple... Yes. then why can't i do this

    Hi,
    how do you get the time and date of your computer.
    i want to write a log file of errors with the time and date it happened. all works except the time and date

    thanks.
    darian

  2. #2
    Join Date
    Aug 2002
    Location
    Cluj-Napoca,Romania
    Posts
    3,496
    GetSystemTime(LPSYSTIME)

    Don't you have any kind of documentation? MSDN is a good starting point for SDK/MFC topics.

  3. #3
    Join Date
    Mar 2004
    Posts
    16

    Thanks

    Thanks so much

    I'll try www.msdn.com

  4. #4
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: Thanks

    Originally posted by darian
    I'll try www.msdn.com
    Besides that, it should be available locally in your VC++ IDE - press F1 to see the local MSDN.

  5. #5
    Join Date
    Sep 2002
    Location
    Maryland - Fear The Turtle!
    Posts
    7,537

    Re: Re: Thanks

    Originally posted by gstercken
    Besides that, it should be available locally in your VC++ IDE - press F1 to see the local MSDN.
    ahh now we see who's still using vc6.0 and the OCT2001 MSDN

  6. #6
    Join Date
    Aug 2002
    Location
    Cluj-Napoca,Romania
    Posts
    3,496
    Oct 2001 MSDN

  7. #7
    Join Date
    Sep 2002
    Location
    Maryland - Fear The Turtle!
    Posts
    7,537
    Originally posted by PadexArt
    Oct 2001 MSDN
    who else says "that just pissed me off" after installing the Jan2002 MSDN and having to go back and fix all the registry settings to get our beloved f-1 back....hey MS...how about coding it up so f-1 works with > MSDN oct2001...ain't that hard...you know we likes to run the help outside of the vc...

  8. #8
    Join Date
    Mar 2004
    Location
    (Upper-) Austria
    Posts
    2,899
    GetLocalTime ( ... ) isn't it a bit better?
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!

  9. #9
    Join Date
    Feb 2004
    Posts
    21
    Try this:

    #include <time.h>

    char CurrentTime[9];
    char CurrentDate[9];

    _strdate(CurrentDate);
    _strtime(CurrentTime);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured