• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3699
  • Last Modified:

calculate current yearly quarter

Im looking for a script I can re-use for one of my own projects, I need to calculate the current quarter in relation to the current month and day, the yearly quarters are standard ones in the range:-


Jan-Mar
Apr-June
July-Sep
Oct-Dec


So for example, today it's Wednesday 22nd March, the current quarter is the first quarter, Im not asking for someone to wrte this for me just trying looking for some links to already created scripts, all my searches turned up with nothing.




Cheers

James
0
JB04
Asked:
JB04
1 Solution
 
RoonaanCommented:
You can just request the month using:

$month = intval(date('m'));

Then calculate the quarter from that.

-r-
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

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

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