?
Solved

PHP strtotime   english phrase   for timestamp (date) desired

Posted on 2014-01-26
6
Medium Priority
?
412 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

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…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
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…
Suggested Courses

771 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