943,861 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 397
  • PHP RSS
Apr 1st, 2009
0

Regardind display of days

Expand Post »
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.
Reputation Points: 16
Solved Threads: 2
Light Poster
srilakshmitr7 is offline Offline
32 posts
since Aug 2008
Apr 1st, 2009
0

Re: Regardind display of days

Convert that date to unixtimestamp using strtotime. Then use date("l") to get the day.
http://in.php.net/date
eg.
php Syntax (Toggle Plain Text)
  1. $date = "2009-03-31";
  2. $timestamp = strtotime($date);
  3. echo date("l",$timestamp);
Moderator
Featured Poster
Reputation Points: 524
Solved Threads: 356
Purple hazed!
nav33n is offline Offline
3,878 posts
since Nov 2007
Apr 1st, 2009
0

Re: Regardind display of days

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.
Reputation Points: 16
Solved Threads: 2
Light Poster
srilakshmitr7 is offline Offline
32 posts
since Aug 2008
Apr 1st, 2009
0

Re: Regardind display of days

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
Moderator
Featured Poster
Reputation Points: 524
Solved Threads: 356
Purple hazed!
nav33n is offline Offline
3,878 posts
since Nov 2007
Apr 1st, 2009
0

Re: Regardind display of days

I gave input as previous year but tried to looking for present year.
Thank you so much.
Reputation Points: 16
Solved Threads: 2
Light Poster
srilakshmitr7 is offline Offline
32 posts
since Aug 2008
Apr 1st, 2009
0

Re: Regardind display of days

You are welcome
Moderator
Featured Poster
Reputation Points: 524
Solved Threads: 356
Purple hazed!
nav33n is offline Offline
3,878 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: add days to a date
Next Thread in PHP Forum Timeline: scrollbar not showing





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC