Re: Determining whether a string is a date, time, or date and time

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



This would not work. The reason I need to know this information is so that I
know whether to include the date, time, or both when submitting the data to
a database. The reason your suggestion will not work is because a Date
object ALWAYS has a date and time, even if the date is the default date or
the time is 0:00 or 12:00 or whatever. Therefore, looking at these parts of
the Date will tell me nothing about whether a date, time, or both were
included in the original String.
--
Nathan Sokalski
njsokalski@xxxxxxxxxxx
http://www.nathansokalski.com/

"Spam Catcher" <spamhoneypot@xxxxxxxxxx> wrote in message
news:Xns9A6DDD5D7857Ausenethoneypotrogers@xxxxxxxxxxxx
"Nathan Sokalski" <njsokalski@xxxxxxxxxxx> wrote in
news:O8ULZv5jIHA.4376@xxxxxxxxxxxxxxxxxxxx:

When determining whether a String can be converted to a DateTime, you
can use the IsDate() method. However, I would also like to know
whether the string is a date, a time, or both a date and a time. Is
there any simple way to do this without using manual pattern matching?
Thanks.

Perhaps you can use the Convert.ToDate() function? Once you convert it to
a
date, you can check the .Date and .Time properties to determine the
original values?



--
spamhoneypot@xxxxxxxxxx (Do not e-mail)


.



Relevant Pages

  • Re: String filtering
    ... Is there some reason you're not doing this in place, ... Is there some reason you're not doing this when you create the original string? ... Jeff Carter "You tiny-brained wipers of other people's bottoms!" ... Monty Python & the Holy Grail ...
    (comp.lang.ada)
  • Re: Love Of Theft - Bob Dylan Outed Again - First On Dylanpool, ThenNY Times
    ... He's submitting them to ... The ethical question is whether Dylan has gone beyond the standards ... Stealing money is wrong, regardless the reason. ... People just think they're above the law and don't even want to consider any other point of view. ...
    (rec.music.dylan)
  • Re: Submission of p-code
    ... p-coded file. ... I do have a genuine reason to do so. ... using p-code. ...
    (comp.soft-sys.matlab)
  • Re: Submission of p-code
    ... p-coded file. ... I do have a genuine reason to do so. ... using p-code. ...
    (comp.soft-sys.matlab)
  • Re: How do I get form elements values BEFORE SUBMIT & AFTER SUBMIT????
    ... Erwin Moller wrote: ... Here is the reason why i ak asking for ur help. ... User can edit some or all the values in the form. ... submitting & after submitting. ...
    (comp.lang.php)