cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
system time using c++2010
system time using c++2010
Mar 17, 2011 at 10:06am UTC
mimou89
(4)
hi friends, I use c + 2010, I want to know how to display time system
in a textbox, I do:
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
DateTime this_day = DateTime::Now;
this->textBox1->Text=Convert::ToString(this_day);
}
=>it displays the date and time system in the same textbox, I want to display the date in a textbox and time system in another textbox!!!
thank you!!
Mar 17, 2011 at 2:39pm UTC
mimou89
(4)
this is the solution:
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
this->richTextBox1->LoadFile("C:\\employe.txt", RichTextBoxStreamType::PlainText);
String ^ day = DateTime::Now.ToString("dd/MM/yyyy");
this->textBox1->Text=Convert::ToString(day);
String ^ this_day = DateTime::Now.ToString("HH:mm:ss");
this->textBox2->Text=Convert::ToString(this_day);
}
Topic archived. No new replies allowed.