472,111 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,111 software developers and data experts.

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 1896
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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.