0

pls someone should help me to format the date_made and date_expired on my form's datetimepickers to "dd/MM/yyyy" date format.See the code below:

Dim listofdrugs As New List(Of Drug)
        For Each ListItem As ListViewItem In lvDrugs.Items
            'change list item and subitems to drug
            Dim newdrug As New Drug
            With newdrug
                .drug_id = ListItem.Text
                .brand_name = ListItem.SubItems(1).Text
                .date_made = ListItem.SubItems(2).Text
                .date_expired = ListItem.SubItems(3).Text


            End With
            listofdrugs.Add(newdrug)
        Next

And save the list of drugs created on the listview(lvDrug) to my access database(DrugDatabase).Thanks.

2
Contributors
1
Reply
17
Views
4 Years
Discussion Span
Last Post by tinstaafl
0

In the datetimepicker's properties set the customformat to dd/MM/yyyy, then change the format property to custom. Now when you assign the value to the listview use the datetimepicker.text, and it will have the correct format.

Edited by tinstaafl

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.