> I have a Datetime of "2008-04-17 00:00:00.000" and a Datetime of
> "2008-04-18 16:55:28.000", and I need to join them to be
>
> "2008-04-17 16:55:28.000"
>
> What is the best way to parse that?
That one example does not sufficiently describe the rules for combining
the two values.
You certainly can take the Date property from one DateTime and add it to
the TimeOfDay property from another DateTime. That's simple enough and in
the very specific example you provided, it would produce the output you
describe.
But is that really what you want to do? If so, why are you using a
DateTime for the second value in the first place? Why not just a TimeSpan
to start with?
Pete
coconet - 21 Apr 2008 21:53 GMT
The datetime values are coming from an antiquated tab-delimited-file
export where the values actually made sense to someone, somewhere.
However in the data-consumer I am writing, I can just use one but I
have to get them together first.
Thanks!
>> I have a Datetime of "2008-04-17 00:00:00.000" and a Datetime of
>> "2008-04-18 16:55:28.000", and I need to join them to be
[quoted text clipped - 16 lines]
>
>Pete
Chris Shepherd - 21 Apr 2008 21:56 GMT
> The datetime values are coming from an antiquated tab-delimited-file
> export where the values actually made sense to someone, somewhere.
> However in the data-consumer I am writing, I can just use one but I
> have to get them together first.
Can you not combine the fields into a single string before parsing?
Chris.