Alright, so I'm not exactly very oriented when it comes to functions available in VB. I have a string containing the current date and time and need to convert it to a integer so i can compare the time.
Dim my_str as String = "201308281110"
Dim my_int as Integer = Convert.ToInt32(my_str)
I cant do that with this string apparently. Because I think it is too long for the 32-bit integer. All the other convertions I have tried also fails. That including "ToInt64", "Int", "CInt"... So, any idea how to convert this longer string to an integer?
Why don't you just simply use Date? You can compare Dates with each other, so there's no need to use an integer for comparing.
Dim my_date as Date = DateTime.ParseExact(my_str, "yyyyMMddhhmm", System.Globalization.CultureInfo.InvariantCulture)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With