Home All Groups Group Topic Archive Search About

Datetimepicker - just getting the data part

Author
3 Oct 2006 8:56 PM
Aussie Rules
Hi,

I have a date time picker on a form, and it returns the date, but inclused a
time value as well.

How can I just get the date part with the time being 00:00

Thanks

Author
3 Oct 2006 9:11 PM
Izzy
Does "00:00" represent a time format? Or do you want just the date
returned and no time.

If so, try it this way:

Dim dtDate As DateTime = Now
        dtDate.ToShortDateString()


Aussie Rules wrote:
Show quoteHide quote
> Hi,
>
> I have a date time picker on a form, and it returns the date, but inclused a
> time value as well.
>
> How can I just get the date part with the time being 00:00
>
> Thanks
Author
3 Oct 2006 10:34 PM
Aussie Rules
Hi,

The value still contains the time component

sDt = dtStartDate.Value
sDt.ToShortDateString()


Thanks
Show quoteHide quote
"Izzy" <israel.rich***@gmail.com> wrote in message
news:1159909908.774342.188350@e3g2000cwe.googlegroups.com...
> Does "00:00" represent a time format? Or do you want just the date
> returned and no time.
>
> If so, try it this way:
>
> Dim dtDate As DateTime = Now
>        dtDate.ToShortDateString()
>
>
> Aussie Rules wrote:
>> Hi,
>>
>> I have a date time picker on a form, and it returns the date, but
>> inclused a
>> time value as well.
>>
>> How can I just get the date part with the time being 00:00
>>
>> Thanks
>
Author
4 Oct 2006 1:31 AM
Izzy
How are you determining there is a time component?

     Dim dtDate As Date = Now
     dtDate.ToShortDateString()

This returns "10/3/2006".

Izzy


Aussie Rules wrote:
Show quoteHide quote
> Hi,
>
> The value still contains the time component
>
> sDt = dtStartDate.Value
> sDt.ToShortDateString()
>
>
> Thanks
> "Izzy" <israel.rich***@gmail.com> wrote in message
> news:1159909908.774342.188350@e3g2000cwe.googlegroups.com...
> > Does "00:00" represent a time format? Or do you want just the date
> > returned and no time.
> >
> > If so, try it this way:
> >
> > Dim dtDate As DateTime = Now
> >        dtDate.ToShortDateString()
> >
> >
> > Aussie Rules wrote:
> >> Hi,
> >>
> >> I have a date time picker on a form, and it returns the date, but
> >> inclused a
> >> time value as well.
> >>
> >> How can I just get the date part with the time being 00:00
> >>
> >> Thanks
> >
Author
4 Oct 2006 4:11 AM
Cor Ligthert [MVP]
Aussie,

> The value still contains the time component

The DateTime structure holds not any Date or Time. It are ticks in the
"long" property Ticks starting at the first day of the year one, confirm
your timezone, which can be represented in all kind of ways.

I hope this gives an idea.

Cor

Show quoteHide quote
"Aussie Rules" <AussieRules@nospam.nospam> schreef in bericht
news:OWrszzz5GHA.5072@TK2MSFTNGP05.phx.gbl...
> Hi,
>
> The value still contains the time component
>
> sDt = dtStartDate.Value
> sDt.ToShortDateString()
>
>
> Thanks
> "Izzy" <israel.rich***@gmail.com> wrote in message
> news:1159909908.774342.188350@e3g2000cwe.googlegroups.com...
>> Does "00:00" represent a time format? Or do you want just the date
>> returned and no time.
>>
>> If so, try it this way:
>>
>> Dim dtDate As DateTime = Now
>>        dtDate.ToShortDateString()
>>
>>
>> Aussie Rules wrote:
>>> Hi,
>>>
>>> I have a date time picker on a form, and it returns the date, but
>>> inclused a
>>> time value as well.
>>>
>>> How can I just get the date part with the time being 00:00
>>>
>>> Thanks
>>
>
>
Author
4 Oct 2006 2:33 AM
Kevin
MyDate = Format(DTPicker1.Value, "Short Date")



On Tue, 3 Oct 2006 21:56:42 +0100, "Aussie Rules"
<AussieRules@nospam.nospam> wrote:

Show quoteHide quote
>Hi,
>
>I have a date time picker on a form, and it returns the date, but inclused a
>time value as well.
>
>How can I just get the date part with the time being 00:00
>
>Thanks
>