calculate current yearly quarter

Posted on 2006-03-22
Last Modified: 2008-03-17
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:-


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.


Question by:JB04
    1 Comment
    LVL 49

    Accepted Solution

    You can just request the month using:

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

    Then calculate the quarter from that.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
    This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    737 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

    22 Experts available now in Live!

    Get 1:1 Help Now