I would like to display the Fiscal Year as "FY13-14" for (July 1, 2013 thru June 30, 2014) and etc. and the Fiscal Quarter I would like to display as "FQ1" "FQ2" etc. The return value is in the range of 1000 to 9999 or 0 for 'zero' date. '/'.$inputyear); I modified this so heavily to use it that I didn't run into that problem (though I haven't finished debugging so maybe I did.). */. By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Then, use format () method to retrieve the year from the newly created object. A fiscal year (or financial year, or sometimes budget year) is used in government accounting, which varies between countries, and for budget purposes.It is also used for financial reporting by businesses and other organizations. format('Y'); //For 4 digit ('Y') for 2 digit ('y') ?> Or you can use it with one line $year = (new DateTime)->format("Y"); If you wanna increase or decrease the year another method; add modify line like below. $fyenddate = strtotime($fyEnd. GETDATE to get the current date; MONTH to turn the date into the month number (e.g. In order to get the current year as four digits, Y is used … (6/30) (12/4/08) your coworkers to find and share information. As we are working on various date function considering todays date, take a fresh copy of SQL dump with date column filled with future dates and past dates considering the todays date. T. here are multiple ways which one can split a date variable in typical date format such as MM-DD-YYYY or MM/DD/YYYY into 3 separate variables for year, month and day in PHP. On an infinite board, which pieces are needed to checkmate? If it is not included then the current date and time will be used. I have a range of dates that sometimes are as follows: 1914-00-00, or 1952-12-00 or 1990-01-31. ?>. $fyenddate = strtotime($fyEnd.$inputyear); should be: This assumes that the financial year for your country is 1 July – 30 June. rev 2020.12.18.38240, Stack Overflow works best with JavaScript enabled, Where developers & technologists share private knowledge with coworkers, Programming & related technical career opportunities, Recruit tech talent & build your employer brand, Reach developers & technologists worldwide, Have you tried any branching logic? Asking for help, clarification, or responding to other answers. Hi friends, I want to get a first month and year of previous and current financial year; last month and year of previous and current financial year. To learn more, see our tips on writing great answers. This can be solved with a simple oneliner: The "n" format character is better in this case, as it returns the month without leading zero.