Patrick B <(E-Mail Removed)> wrote:
> Ahh, I get you...
>
> DateTime C = new DateTime(A.Year, A.Month, A.Day, B.Hour, B.Minute,
> B.Second);
>
> Thanks, that works.
Goodo - but actually, looking at your original post, I don't see why
that shouldn't work. For instance:
using System;
class Test
{
static void Main()
{
DateTime now = DateTime.Now;
DateTime yesterday = DateTime.Today.AddDays(-1);
DateTime thisTimeYesterday = yesterday.Date+now.TimeOfDay;
Console.WriteLine(thisTimeYesterday);
}
}
--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too