TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
harish reddy
NA
162
33.8k
Datetime and day of week
Mar 8 2018 9:54 PM
Write a program, which prints, on the console which day of the week is today
1. //DayOfWeek now = DateTime.Today.DayOfWeek;
//Console.WriteLine(now);
2. DateTime today = DateTime.Today;
string date=today.DayOfWeek;
Console.WriteLine(today);
Questions are :
A) With the first code i am getting the value....but with the second i am not getting. I want to know how we can do from 2nd one...
B) Also we have DATETIME and DAYOFWEEK. which one should we use while using IDE?
C) Also i get confused should we use brackets at the end or not ? in what cases should we use brackets .
For example if i give DayOfWeek now = DateTime.Today.DayOfWeek(); it gives me error.
But if i give DayOfWeek now = DateTime.Today.DayOfWeek; it works. What is the concept here? Pls suggest
Reply
Answers (
2
)
How to change layout page after login in mvc using angularjs
Probs in Making a setup in visual studio 2017