469,090 Members | 1,257 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,090 developers. It's quick & easy.

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?

Expand|Select|Wrap|Line Numbers
  1. Dim lblNewDate As Date = Date.ParseExact(lblDate.Text.ToString(), "dd/mm/yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo)
  2.             If isDataAvailable = 1 Then
  3.                 dayName = planDay
  4.             Else
  5.                 dayName = DateAndTime.WeekdayName(DateAndTime.Weekday(lblNewDate))
  6.             End If
  7.  
  8.             lblDayName.ID = "lblDayName" & numOfRows
  9.             lblDayName.Text = dayName
  10.  
Oct 19 '12 #1
2 1848
Killer42
8,435 Expert 8TB
In VB6 (which is what this forum is about) you'd simply use the Format$() function. For VB.Net you really should post here.
Oct 19 '12 #2
IraComm
14
Should still work in .net
Expand|Select|Wrap|Line Numbers
  1. Format(Weekday(Date), "ddd")
Oct 30 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

13 posts views Thread by Dr John Stockton | last post: by
388 posts views Thread by maniac | last post: by
2 posts views Thread by Steve Teeples | last post: by
13 posts views Thread by Bob Day | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.