Re: Dates are Evil! HELP!
- From: "Patrice" <a@xxxx>
- Date: Mon, 6 Mar 2006 10:50:35 +0100
Are you sure ? IMO the date is not enclosed in # but anyway
ToShortDateString returns a *string*. You shouldn't use this at all to
compare "real" dates and not strings :
If tmpEvent.StartDate <= Date.Now Then
Also keep in mind that the date is not "entered as 1/1/1900" in the database
(assuming you have used the appropriate data type). Dates are always stored
the same internally. How they are printed depends on regional settings but a
given date has always the same internal representation.
Just make sure to compare dates to dates (and not dates to strings) so that
you compare their intela representation and not how they "look like" as text
in a particular language.
--
Patrice
<labelle@xxxxxxxxx> a écrit dans le message de
news:1141413115.327630.115170@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The dates being posted in the database are being entered as 1/1/1900
and i know Date.Now.ToShortDateString gives a day that says # 3/3/2006
#
Are those hash signs messing me up? I just don't understand what's
going on. I set a breakpoint and it clearly shows tmpEvent.StartDate
as 1/1/2006 and Date.Now as today's date.
.
- References:
- Dates are Evil! HELP!
- From: labelle
- Re: Dates are Evil! HELP!
- From: Patrice
- Re: Dates are Evil! HELP!
- From: labelle@xxxxxxxxx
- Dates are Evil! HELP!
- Prev by Date: RE: Create application to extract data from excel ***
- Next by Date: Re: Sum UP datagrid 's content fail in 2005
- Previous by thread: Re: Dates are Evil! HELP!
- Next by thread: Re: Dates are Evil! HELP!
- Index(es):