Regardind display of days

Reply

Join Date: Aug 2008
Posts: 31
Reputation: srilakshmitr7 is an unknown quantity at this point 
Solved Threads: 2
srilakshmitr7's Avatar
srilakshmitr7 srilakshmitr7 is offline Offline
Light Poster

Regardind display of days

 
0
  #1
Apr 1st, 2009
In php if we provide a particulr date how to display the name of the day i.e; whether that day lies on sunday or monday...

Can you please give me idea.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,760
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Regardind display of days

 
0
  #2
Apr 1st, 2009
Convert that date to unixtimestamp using strtotime. Then use date("l") to get the day.
http://in.php.net/date
eg.
  1. $date = "2009-03-31";
  2. $timestamp = strtotime($date);
  3. echo date("l",$timestamp);
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 31
Reputation: srilakshmitr7 is an unknown quantity at this point 
Solved Threads: 2
srilakshmitr7's Avatar
srilakshmitr7 srilakshmitr7 is offline Offline
Light Poster

Re: Regardind display of days

 
0
  #3
Apr 1st, 2009
I want to dsiplay it irrespective of year for example if i give the date that belongs to year 1987 it should display the day with respect to present year.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,760
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Regardind display of days

 
0
  #4
Apr 1st, 2009
Originally Posted by srilakshmitr7 View Post
I want to dsiplay it irrespective of year for example if i give the date that belongs to year 1987 it should display the day with respect to present year.
Yes. That is what it does. Try out that example by giving 1987's date
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 31
Reputation: srilakshmitr7 is an unknown quantity at this point 
Solved Threads: 2
srilakshmitr7's Avatar
srilakshmitr7 srilakshmitr7 is offline Offline
Light Poster

Re: Regardind display of days

 
0
  #5
Apr 1st, 2009
I gave input as previous year but tried to looking for present year.
Thank you so much.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,760
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Regardind display of days

 
0
  #6
Apr 1st, 2009
You are welcome
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC