on 09-30-2008 11:56 AM
Hi, how can i assign a start date and a start time to an activity with di-api?
i tried it with
oContact.StartTime = Convert.ToDateTime(dtDatum.ToString("dd/MM/yy") + " " + sVon);
oContact.EndTime = Convert.ToDateTime(dtDatum.ToString("dd/MM/yy") + " " + sBis);
but, it always get assigned "01.12.1899" or so...
what did i do wrong?
Hello Phillipp,
Here is an example how to convert string into datetime. Hope it helps.
string[] dateStrings = {"2008-05-01T07:34:42+8:00",
"2008-05-01 7:34:42Z",
"Thu, 01 May 2008 07:34:42 GMT"};
foreach (string dateString in dateStrings)
{
DateTime convertedDate = DateTime.Parse(dateString);
Console.WriteLine("Converted {0} to {1} time {2}.",
dateString,
convertedDate.Kind.ToString(),
convertedDate);
}
Console.WriteLine("Now waiting for the requests");
Console.ReadLine();
http://msdn.microsoft.com/en-us/library/1k1skd40.aspx#Mtps_DropDownFilterText
Kind Regards
-Yatsea
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
7 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.