Click here to Skip to main content
15,896,154 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: SMS through my app Pin
parths5-Jan-04 21:28
parths5-Jan-04 21:28 
QuestionHow do I get my IP address when I am on line? Pin
Anonymous5-Jan-04 16:52
Anonymous5-Jan-04 16:52 
AnswerRe: How do I get my IP address when I am on line? Pin
Roger Wright5-Jan-04 17:47
professionalRoger Wright5-Jan-04 17:47 
AnswerRe: How do I get my IP address when I am on line? Pin
kvenkat5-Jan-04 18:21
kvenkat5-Jan-04 18:21 
GeneralTask Bar Icons Pin
User 5838525-Jan-04 16:50
User 5838525-Jan-04 16:50 
GeneralRe: Task Bar Icons Pin
Monty25-Jan-04 21:57
Monty25-Jan-04 21:57 
GeneralLittle Help please Pin
ViTToRi05-Jan-04 15:45
ViTToRi05-Jan-04 15:45 
GeneralRe: Little Help please Pin
Christian Graus5-Jan-04 16:08
protectorChristian Graus5-Jan-04 16:08 
You want to put the time that the update happened ? This from the MSDN


#include <stdio.h>
#include <string.h>
#include <time.h>

void main( void )
{
struct tm *newtime;
char am_pm[] = "AM";
__time64_t long_time;

_time64( &long_time ); /* Get time as long integer. */
newtime = _localtime64( &long_time ); /* Convert to local time. */

if( newtime->tm_hour > 12 ) /* Set up extension. */
strcpy( am_pm, "PM" );
if( newtime->tm_hour > 12 ) /* Convert from 24-hour */
newtime->tm_hour -= 12; /* to 12-hour clock. */
if( newtime->tm_hour == 0 ) /*Set hour to 12 if midnight. */
newtime->tm_hour = 12;

printf( "%.19s %s\n", asctime( newtime ), am_pm );
}


Output
Fri Jan 22 10:03:48 AM


I don't recall if it's ctime or time, but you should not include time.h as it is deprecated. This will mean that the methods you want will be in namespace std.

Christian

I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
QuestionHow to enumerate all the files in a directory? Pin
George25-Jan-04 15:12
George25-Jan-04 15:12 
AnswerRe: How to enumerate all the files in a directory? Pin
Prakash Nadar5-Jan-04 16:02
Prakash Nadar5-Jan-04 16:02 
GeneralRe: How to enumerate all the files in a directory? Pin
George25-Jan-04 17:30
George25-Jan-04 17:30 
QuestionHow to use! Pin
skylonely5-Jan-04 15:04
skylonely5-Jan-04 15:04 
AnswerRe: How to use! Pin
abc8765-Jan-04 20:07
abc8765-Jan-04 20:07 
QuestionHow can I produce a report ... Pin
Qadddd5-Jan-04 12:13
Qadddd5-Jan-04 12:13 
AnswerRe: How can I produce a report ... Pin
Jörgen Sigvardsson5-Jan-04 12:49
Jörgen Sigvardsson5-Jan-04 12:49 
GeneralRe: How can I produce a report ... Pin
Qadddd5-Jan-04 22:20
Qadddd5-Jan-04 22:20 
GeneralRe: How can I produce a report ... Pin
Jörgen Sigvardsson5-Jan-04 23:47
Jörgen Sigvardsson5-Jan-04 23:47 
GeneralRe: How can I produce a report ... Pin
Qadddd16-Feb-04 13:00
Qadddd16-Feb-04 13:00 
GeneralProper organization of .cpp and .h files. Pin
blackmesa5-Jan-04 11:59
blackmesa5-Jan-04 11:59 
GeneralRe: Proper organization of .cpp and .h files. Pin
Jörgen Sigvardsson5-Jan-04 12:51
Jörgen Sigvardsson5-Jan-04 12:51 
Generalproblem with gethostbyaddr Pin
Chernobog15-Jan-04 11:47
Chernobog15-Jan-04 11:47 
GeneralRe: problem with gethostbyaddr Pin
Jörgen Sigvardsson6-Jan-04 0:15
Jörgen Sigvardsson6-Jan-04 0:15 
GeneralRe: problem with gethostbyaddr Pin
David Crow6-Jan-04 5:07
David Crow6-Jan-04 5:07 
GeneralRe: problem with gethostbyaddr Pin
Chernobog17-Jan-04 12:22
Chernobog17-Jan-04 12:22 
GeneralNewbie C++ question Pin
Anonymous5-Jan-04 11:26
Anonymous5-Jan-04 11:26 

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.