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

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -