0

Im trying to put current system time in YYMMDD format but having problem with day function.
is Day() which returned day of month in VB6 not available in VB.Net?
If I want to get the current day of month, how would I do that?

Dim dt As Date
Dim dtString As String

dtString = Year(now()) + Month(now()) + Day(now())
3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by bluehangook629
0

See If this helps.

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        MsgBox(xDate)
        MsgBox(xDate("dd"))
    End Sub
    Private Function xDate(Optional ByVal selDateFormat As String = "MM.dd.yyyy") As String
        Return Date.Now.ToString(selDateFormat)
    End Function
0

Im trying to put current system time in YYMMDD format but having problem with day function.
is Day() which returned day of month in VB6 not available in VB.Net?
If I want to get the current day of month, how would I do that?

Dim dt As Date
Dim dtString As String

dtString = Year(now()) + Month(now()) + Day(now())

Use the below code so that u can get the system date

Dim d As String = Format(Today, "yy/MM/dd")
TextBox1.Text = d
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.