DateTime Question

 

I am trying to convert two string values to a datetime value but I cant get it right can anyone help...

My two string values are:

string aDate = eDate[n];

string aTime = eTime[n];

Wnat I need is

datetime aDateTime[n] = StrToTime(eDate[n]+eTime[n]);

just does not seem to work any suggestions?

 
Kurka Fund:
I am trying to convert two string values to a datetime value but I cant get it right can anyone help...

My two string values are:

string aDate = eDate[n];

string aTime = eTime[n];

Wnat I need is

datetime aDateTime[n] = StrToTime(eDate[n]+eTime[n]);

just does not seem to work any suggestions?

I'd try adding a space between the date and time strings to get the formatting correct. I'm not sure if it will work:

datetime aDateTime[n] = StrToTime(eDate[n]+" "+eTime[n]);

 
ralph.ronnquist:
Or maybe:
datetime aDateTime[n] = StrToTime( eDate[n] ) + StrToTime( eTime[n] ); [/PHP]

This is certainly wrong, the use of StrToTime() is :

datetime StrToTime( string value)

Converts string in the format "yyyy.mm.dd hh:mi" to datetime type (the amount of seconds that have passed since 1 Jan., 1970).

So the suggestion of Ryan should work if eDate[] and eTime[] are right formated (yyyy.mm.dd) and (hh:mi)[PHP]datetime aDateTime[n] = StrToTime(eDate[n]+" "+eTime[n]);
 

Deleted; Michel is quite right.

 

worked thanks you guys are awesome...

Reason: