Sponsored Content
Operating Systems Linux How to calculate the quarter end date according to the current date in shell script? Post 303036034 by Scrutinizer on Thursday 13th of June 2019 04:53:36 AM
Old 06-13-2019
Hi,

the 4 quarter end dates are the same each year, so you could take the month number and check in which range it lies: 1-3, 4-6, 7-9 or 10-12. Then you know which quarter end date applies..

S.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

calculate the date of next satureday of current date.

I want to calculate the date of next satureday of current date using shell script. Suppose, today is 27-feb-08 I want to get the date of next satureday, which means 01-mar-08, in the formate '' YYMMDD ". I do this in ksh.. Please tell me any type of command which help me out. Thanks in... (3 Replies)
Discussion started by: rinku
3 Replies

2. Shell Programming and Scripting

Calculate Date from shell script

I have a txt file which now has the following output Sat Mar 6 04:00:01 Sat Mar 6 04:02:09 processing 585 Sat Mar 6 17:00:01 Sat Mar 6 17:00:58 processing 109 Sun Mar 7 04:00:01 Sun Mar 7 04:00:51 processing 309 Sun Mar 7 17:00:01 Sun Mar 7 17:00:41 processing 48 I want output as... (1 Reply)
Discussion started by: gubbu
1 Replies

3. Shell Programming and Scripting

Shell Script to compare files, check current date and count

Hello - I have written the following basic shell script to count files, compare files and look for a particular strings in a file. Problem 1: How do I define more than 1 file location? #!/bin/bash #this is a test script FILES=$(ls /home/student/bin/dir1, home/student/bin/dir2)... (0 Replies)
Discussion started by: DallasT
0 Replies

4. Shell Programming and Scripting

Generate quarter dates with begin date and end date

Hi All, I am trying to generate quarter dates with user giving input as begin date and end date. Example: Input by user: begin_date = "2009-01-01" end_date = 2010-04-30" required output: 2009-01-01 2009-03-31 09Q01 2009-04-01 2009-06-30 09Q02 . . till 2010-01-01 2010-03-31 10Q01 ... (9 Replies)
Discussion started by: sol_nov
9 Replies

5. Shell Programming and Scripting

Date One Week Ago From Given Date, Not From Current Date

Hi all, I've used various scripts in the past to work out the date last week from the current date, however I now have a need to work out the date 1 week from a given date. So for example, if I have a date of the 23rd July 2010, I would like a script that can work out that one week back was... (4 Replies)
Discussion started by: Donkey25
4 Replies

6. Shell Programming and Scripting

How to Get 60 days Old date from current date in KSH script

Hi i am writing a cron job. so for it i need the 60 days old date form current date in variable. Like today date is 27 jan 2011 then output value will be stote in variable in formet Nov 27. i am using EST date, and tried lot of solution and see lot of post but it did not helpful for me. so... (3 Replies)
Discussion started by: Himanshu_soni
3 Replies

7. Shell Programming and Scripting

Substracting days from current date(K shell script)

Hi, I want to subtract 'n' days from the current timestamp in a k shell script. Is there any inbuilt function to do it or any workaround solution to get the date. And I want the output to be in YYYY:MM:DD HH:MM:SS format. Please help. Thanks in advance. (4 Replies)
Discussion started by: Suryaaravindh
4 Replies

8. Programming

Calculate the current date.

Give your an integer (e.g. 0x0076f676) representing the number of minutes elapsed since January 1, 1996. How to calculate the current date which format should be "year-month-day-hour-minutes" ? (3 Replies)
Discussion started by: qcmao
3 Replies

9. Shell Programming and Scripting

Shell script to check current date file is created and with >0 kb or not for multiple directories

Hi All, I am new in scripting and working in a project where we have RSyslog servers over CentOS v7 and more than 200 network devices are sending logs to each RSyslog servers. For each network devices individual folders create on the name of the each network devices IP addresses.The main... (7 Replies)
Discussion started by: Pinaki
7 Replies

10. UNIX for Beginners Questions & Answers

UNIX script to replace old date with current date dynamically in multiple files present in a folder

I am trying to work on a script where it is a *(star) delimited file has a multiple lines starts with RTG and 3rd column=TD8 I want to substring the date part and I want to replace with currentdate minus 15 days. Here is an example. iam using AIX server $ cat temp.txt RTG*888*TD8*20180201~... (1 Reply)
Discussion started by: Shankar455
1 Replies
Oxford::Calendar(3pm)					User Contributed Perl Documentation				     Oxford::Calendar(3pm)

NAME
Oxford::Calendar - University of Oxford calendar conversion routines SYNOPSIS
use 5.10.0; use Oxford::Calendar; use Date::Calc; say "Today is " . Oxford::Calendar::ToOx(reverse Date::Calc::Today); DESCRIPTION
This module converts University of Oxford dates (Oxford academic dates) to and from Real World dates, and provides information on Terms of the University. The Terms of the University are defined by the Regulations on the number and lengths of terms, available online from http://www.admin.ox.ac.uk/examregs/03-00_REGULATIONS_ON_THE_NUMBER_AND_LENGTH_OF_TERMS.shtml <http://www.admin.ox.ac.uk/examregs/03-00_REGULATIONS_ON_THE_NUMBER_AND_LENGTH_OF_TERMS.shtml> This document describes the start and end dates of Oxford Terms. In addition to this, the dates of Full Term, required to calculate the week number of the term, are prescribed by Council, and published periodically in the University Gazette. Full term comprises weeks 1-8 inclusive, but sometimes, dates outside of full term are presented in the Oxford academic date format. This module will optionally provide such dates. Data for these prescribed dates may be supplied in the file /etc/oxford-calendar.yaml; if this file does not exist, built-in data will be used. The built-in data is periodically updated from the semi-authoritative source at <http://www.ox.ac.uk/about_the_university/university_year/dates_of_term.html>. or the authoritative source, the Gazette, available online from <http://www.ox.ac.uk/gazette/>. <http://www.ox.ac.uk/about_the_university/university_year/index.html> describes the academic year at Oxford. DATE FORMAT
An Oxford academic date has the following format: <day of week>, <week number>[st,nd,rd,th] week, <term name> <year> where term name is one of o Michaelmas (autumn) o Hilary (spring) o Trinity (summer) Example: Friday, 8th Week, Michaelmas 2007 FUNCTIONS
ToOx($day, $month, $year, [\%options]) Given a day, month and year in standard human format (that is, month is 1-12, not 0-11, and year is four digits) will return a string of the form Day, xth week, Term year or an array (Day, week of term, Term, year) depending on how it is called. The exact behaviour is modified by the 'mode' option described below. If the requested date is not in full term or extended term (see below), undef will be returned. If the requested date is not covered by the database, ToOx will die with an "out of range" error message. Therefore it is recommended to eval ToOx with appropriate error handling. %options can contain additional named parameter options: mode Several modes are available: full_term Term dates will only be returned if the date requested is part of a full term (as defined by the web page above). ext_term Term dates will only be returned if the date requested is part of an extended term, or statutory term. nearest Will return term dates based on the nearest term, even if the date requested is not part of an extended term (i.e. will include fictional week numbers). This is currently the default behaviour, for backwards compatibility with previous releases; this may be changed in future. confirmed If true, ignores dates marked as provisional in the database. ThisTerm($year, $month, $day) Given a year, month, term in standard human format (that is, month is 1-12, not 0-11, and year is four digits) will returns the current term or undef if in vacation or unknown. The term is given as an array in the form (year, term). NextTerm($year, $month, $day) Given a day, month and year in standard human format (that is, month is 1-12, not 0-11, and year is four digits) will return the next term (whether or not the date given is in term time). The term is given as an array in the form (year, term). StatutoryTermDates($year) Returns a hash reference keyed on terms for a given year, the value of each being a hash reference containing start and end dates for that term. The dates are stored as array references containing numeric year, month, day values. Note: these are the statutory term dates, not full term dates. Parse($string) Takes a free-form description of an Oxford calendar date, and attempts to divine the expected meaning. If the name of a term is not found, the current term will be assumed. If the description is unparsable, undef is returned. Otherwise, an array will be returned of the form "($year,$term,$week,$day)". This function is experimental. FromOx($year, $term, $week, $day) Converts an Oxford date into a Gregorian date, returning a string of the form "DD/MM/YYYY" or undef. The arguments are of the same format as returned by ToOx in array context; that is, a four-digit year, the name of the term, the week number, and the name of the day of week (e.g. 'Sunday'). If the requested date is not covered by the database, FromOx will die with an "out of range" error message. Therefore it is recommended to eval ToOx with appropriate error handling. BUGS
Bugs may be browsed and submitted at http://rt.cpan.org/Public/Dist/Display.html?Name=Oxford-Calendar <http://rt.cpan.org/Public/Dist/Display.html?Name=Oxford-Calendar> A copy of the maintainer's git repository may be found at https://github.com/jmdh/Oxford-Calendar <https://github.com/jmdh/Oxford-Calendar> AUTHOR
Simon Cozens is the original author of this module. Eugene van der Pijll, "pijll@cpan.org" took over maintenance from Simon for a time. Dominic Hargreaves currently maintains this module for the Computing Services, University of Oxford. perl v5.14.2 2012-06-26 Oxford::Calendar(3pm)
All times are GMT -4. The time now is 03:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy