vb.net - Result is with the time format 2:15:59 PM but expected 14:15:59 -


i not pro vb net question newbies... have problem convert string datetime, here's portion of code:

dim aaa = datetime.parseexact("20160409 141559", "yyyymmdd hhmmss", cultureinfo.currentculture) 

the result time format 2:15:59 pm expected 14:15:59

you need format result aaa date suits you.

datetime.parseexact("20160409 141559", "yyyymmdd hhmmss", cultureinfo.currentculture).tostring("yyyymmdd hhmmss") 

to result of 14:15 use code above , add semicolons need inside tostring("yyyymmdd hhmmss") function.


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -