print the current time on the screen

A

Allen Maki

Hi everybody,



I need help.



I want to print the current time on the screen. After research I managed to
run the codes below in regular C++. But I could not make it to run in .NET
Framework environment. Can anybody tell me how to make these codes to work
in .NET Framework or show me an alternative codes?



/*

the author said that you have to turn on debug multi-threading to make this
program works

*/



#include <afx.h>

#include <iostream>

using namespace std;



int main()

{

CTime now = CTime::GetCurrentTime();

CString str = now.Format(" %H:%M:%S - ");

cout << str << endl;



return 0;

}
 
S

Steve C. Orr [MCSD, MVP, CSM, ASP Insider]

You're trying to print this out in a web page right?
You're best off probably putting it in a label control.
The C# code would be similar to this:

Label1.Text = DateTime.Now();
 
M

Mark Rae

You're trying to print this out in a web page right?

That's what I thought, until I saw that the OP had also posted the same
question in the adonet newsgroup...???
 
A

Allen Maki

No I do not want it for Web


Mark Rae said:
That's what I thought, until I saw that the OP had also posted the same
question in the adonet newsgroup...???
 
S

Steve C. Orr [MCSD, MVP, CSM, ASP Insider]

Then you're in the wrong newsgroup.
This is for ASP.NET.
 
J

Juan T. Llibre

You're in the wrong newsgroup, then.

Post to microsoft.public.dotnet.framework
if you want to do whatever in a non-web application.

This is a web-oriented newsgroup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top