article

Get the name of the day today!

Email
Submitted on: 1/1/2015 7:41:00 PM
By: Christer Bru (from psc cd)  
Level: Beginner
User Rating: By 4 Users
Compatibility: Delphi 7, Delphi 6, Delphi 5, Delphi 4, Pre Delphi 4
Views: 2278
 
     Easy-to-understand-function that returns the day todays name in string and takes no parameters. It returns the name in Englsih even if the operating system is another laguage. Good for text editing programs. Please rate...

 
				Here is an example of what the function returns: 
'The day today is ' + daytoday+'.'
Returns on a monday:
The day today is Monday.

Here is the function:
function daytoday: string;
begin
Result:=''; {Can be removed}
if dayofweek(now)=1 then
result:='Sunday' else
if dayofweek(now)=2 then
result:='Monday' else
if dayofweek(now)=3 then
result:='Tuesday' else
if dayofweek(now)=4 then
result:='Wednesday' else
if dayofweek(now)=5 then
result:='Thursday' else
if dayofweek(now)=6 then
result:='Friday' else
if dayofweek(now)=7 then
result:='Saturday';
end;


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.