Solved

PHP strtotime   english phrase   for timestamp (date) desired

Posted on 2014-01-26
6
399 Views
Last Modified: 2014-01-26
i get year=1969 with the following function calls.
please help me correct what i'm doing wrong

      $ThisMonthStamp = strtotime("first day of this month");
      $ThisMonthYear  = date("Y", $ThisMonthStamp);
        echo $ThisMonthYear;

1969    <-- result displayed

this was executed today, 1/26/2014
0
Comment
Question by:willsherwood
  • 3
  • 3
6 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39811003
On the man page http://us1.php.net/manual/en/function.strtotime.php , there is a link in the parameters section for Date and Time Formats.  They kind of overstate what it will actually accept.
0
 

Author Comment

by:willsherwood
ID: 39811019
so you're suggesting my example isn't supported?
is there an alternate wording/syntax to achieve a similar result?
thanks!
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39811022
Please read the pages I linked.  That's the 'official' words on the subject.

PS:  'this' doesn't mean anything to the function.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:willsherwood
ID: 39811036
i will re read again with a fine tooth comb to try to sort out your specific recommendation now that i understand you're specifically telling me about "THIS"

thanks
0
 

Author Comment

by:willsherwood
ID: 39811038
p.s.  i had similar results of 1969   with   next    and     last
so evidently not much works with that function
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39811040
It is very picky and I have rarely used it.  Thanks for the points.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now