Quantcast
Channel: DateTime::ParseExact
Viewing all articles
Browse latest Browse all 6

DateTime::ParseExact

$
0
0

Can someone help me with the getting my ParseExact working? Though following guidance from MSDN site I am still incorrect with my syntax. The error I am receiving is the following:

Error C2665: 'System::DateTime::ParseExact' : none of the 3 overloads could convert all the argument types.
 
C2665- Error Description: 'function' : none of the number1 overloads can convert parameter number2 from type 'type'

#include <stdio.h>
#include <vcclr.h>
#include <windows.h>
#include <string>

#using <mscorlib.dll>

using namespace std;
using namespace System;
using namespace System::Globalization;
using namespace System::Collections;

void main()
	{
	//System::Collections::IEnumerator^ en = CultureInfo::GetCultures(CultureTypes::SpecificCultures)->GetEnumerator();
	//System::Globalization::CultureInfo^ MyCI = gcnew CultureInfo("en-US",false);
	//System::Globalization::DateTimeFormatInfo^ myDTFI = MyCI->DateTimeFormat;				
	std::string dateString = "MAY_03_2010";
	std::string format = "MMM_dd_yyyy";
	//	DateTime dt = DateTime::Now;	
	DateTime dateTime = DateTime::ParseExact(dateString,format,nullptr);
	//System::DateTime dateTimevalue = System::DateTime::ParseExact(dateString,"MMMddyyyy",CultureInfo.InvariantCulture); 

	system("pause");
}

 

Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images