davin kurniadi
davin kurniadi

Reputation: 19

how to change label type into date type in vb.net

i'm trying to convert this string type into date time Here :

Dim podate As Label = 19/12/2016
Dim datedate As Date = Date.Now
datedate = Convert.ToDateTime(podate).toString("yyyyMMdd")

and the result it says : Input string was not in a correct format. any idea where did i wrong?

Upvotes: 0

Views: 916

Answers (1)

Shadow Fiend
Shadow Fiend

Reputation: 351

You can do something like this

Dim podate as String
Dim podateToString as String

podate = "19/12/2016"
podateToString = podate

podateToString.ToString("yyyyMMdd")

Upvotes: 1

Related Questions