Hi all


Im loading list box with availabel datetime formats . but it is loading all the date time formats twice...
here is my code:


Dim dateTime As DateTime = New _
DateTime(Now.Year, Now.Month, Now.Day, Now.Hour, _
Now.Minute, Now.Second)
Dim d() As String = Nothing
d = dateTime.GetDateTimeFormats()
lstdateandtime.Items.AddRange(d)
how to sort out this issue?

Recommended Answers

All 5 Replies

i think its not twice but all formats of date-time. short or long formats, country formats..
why don't use datetime picker?

ListBox1.Items.Add(DateTimePicker1.Value.Now)

Thanks for ur reply Jx_man. if i use date time picker it loads only one format of date.
and i want to load the listbox with all available datetime formats..
My code is loading all datetime formats but values are repeating i dont know why
is there any way to sort them?


thanks.

Thanks for ur reply Jx_man. if i use date time picker it loads only one format of date.
and i want to load the listbox with all available datetime formats..
My code is loading all datetime formats but values are repeating i dont know why
is there any way to sort them?


thanks.

Any one have idea about this issue?

lstdateandtime.Sorted = True

No if i use sort it just sort it by name or somthing.
it is not going remove the duplicates.
any how i managed to elimanate the duplictes.
Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.