×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

DayOfWeek as String

DayOfWeek as String

DayOfWeek as String

(OP)
Colleagues,
The code below shows me the numeric (Int) sequential number of the day (in this case - Friday):

CODE --> vb

Dim ldToday As Date = Today, ldLastWeek As Date = ldToday.AddDays(-7), lcDate As String = ldLastWeek.ToString(Format("d")), _
    lcFriday As String = "", ldFriday As Date = ldLastWeek
'MsgBox("Today: " & ldToday.ToString("d") & vbCrLf & "Last week: " & ldLastWeek.ToString("d") & vbCrLf & lcDate)
Do While ldFriday.DayOfWeek < DayOfWeek.Friday
   ldFriday = ldFriday.AddDays(1)
Loop

MsgBox(ldFriday.DayOfWeek) 

I cannot find how to convert it into the String (s./b. "Friday") - HOW-TO?
TIA!

Regards,

Ilya

RE: DayOfWeek as String

Hi,

CODE

Module Module1
    Sub Main()
        ' Use current time.
        ' ... Use a format.
        ' ... Write to console.
        Dim time As DateTime = DateTime.Now
        Dim format As String = "dddd"     '... ddd==Mon, Tue... dddd==Monday, Tuesday...
        Console.WriteLine(time.ToString(format))
    End Sub
End Module 

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein

RE: DayOfWeek as String

(OP)
Works!
Great!
thanks2

Regards,

Ilya

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close