How can I initialise a Datetime^ variable with current Date?
I have this idea but I'm not sure: Datetime^ curDate = gcnew DateTime::Now; Anyone?

Recommended Answers

All 2 Replies

Not sure, but does this work?

Datetime^ curDate = gcnew Datetime();
curDate = DateTime::Now;

This is the right way to do it:

DateTime^ Date = gcnew DateTime();
	Date = Date->Now;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.