How to format a day name to short day name, i.e if monday means "mon" tuesday "tue"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • raficomps
    New Member
    • Oct 2012
    • 1

    How to format a day name to short day name, i.e if monday means "mon" tuesday "tue"

    I am using dynamic controls, in that i want day name to be short instead of Monday "Mon" like this. How can I do it dynamically?

    Code:
    Dim lblNewDate As Date = Date.ParseExact(lblDate.Text.ToString(), "dd/mm/yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo)
                If isDataAvailable = 1 Then
                    dayName = planDay
                Else
                    dayName = DateAndTime.WeekdayName(DateAndTime.Weekday(lblNewDate))
                End If
    
                lblDayName.ID = "lblDayName" & numOfRows
                lblDayName.Text = dayName
    Last edited by Meetee; Oct 19 '12, 07:25 AM. Reason: Please do not make different threads for the similar question
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    In VB6 (which is what this forum is about) you'd simply use the Format$() function. For VB.Net you really should post here.

    Comment

    • IraComm
      New Member
      • Oct 2012
      • 14

      #3
      Should still work in .net
      Code:
      Format(Weekday(Date), "ddd")

      Comment

      Working...