Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > dotnet framework > april 2008 >

dotnet framework : DateTime Adding Parse Help


Peter Duniho
4/18/2008 12:51:26 PM
On Fri, 18 Apr 2008 12:41:20 -0700, coconet <coconet@community.nospam>
[quoted text, click to view]

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?

coconet
4/18/2008 3:41:20 PM

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?

Thanks.


coconet
4/21/2008 4:53:27 PM
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!


On Fri, 18 Apr 2008 12:51:26 -0700, "Peter Duniho"
[quoted text, click to view]
Chris Shepherd
4/21/2008 4:56:42 PM
[quoted text, click to view]

Can you not combine the fields into a single string before parsing?

AddThis Social Bookmark Button