Get the current date and time

vb.net, winforms

Solution

use `DateTime.Now`

try this:

DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")

Problem

I want to get the current date and time. For example: ``` 2012/11/13 06:30:38 ``` What I have tried: ``` Dim d As System.DateTime MsgBox(d.Year) 'Return 1 ```

Original source

Related problems