Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 422
  • Last Modified:

PHP strtotime english phrase for timestamp (date) desired

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
willsherwood
Asked:
willsherwood
  • 3
  • 3
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
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
 
willsherwoodAuthor Commented:
so you're suggesting my example isn't supported?
is there an alternate wording/syntax to achieve a similar result?
thanks!
0
 
Dave BaldwinFixer of ProblemsCommented:
Please read the pages I linked.  That's the 'official' words on the subject.

PS:  'this' doesn't mean anything to the function.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
willsherwoodAuthor Commented:
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
 
willsherwoodAuthor Commented:
p.s.  i had similar results of 1969   with   next    and     last
so evidently not much works with that function
0
 
Dave BaldwinFixer of ProblemsCommented:
It is very picky and I have rarely used it.  Thanks for the points.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now