Sponsored Content
Top Forums Shell Programming and Scripting How to add decimal month to some month in sql, php, perl, bash, sh? Post 302904107 by bacarrdy on Monday 2nd of June 2014 08:06:01 AM
Old 06-02-2014
no, it`s for my web page

i tryed to do that in php in this way:

i keept in mind that all months have 31 days and after adding 2 moths ( in my example 2.54 ) ( never mind to wich date ) i calculated how much days i should take of ( for example if month 2 have 28 days and i keept in mind that all month have 31 days so for that month i must take - 3 days ) and after that i added thous 0.54 of that month days.

but its dificult to test all posibilities of errors and in some ways i get few days in answer bad.

i got errors when i was calculated end of months wich ones have 30;29;28 days

so in php my experianse is to week, but i practise bash sh languages, so i`m asking meaby there is any simple way to calculate it ( meaby use unix time ( meaby it have some extensions for it ) ) in bash sh ( if yes then ill simple from my web page will shell_exec to bash and ill take the values from it )
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl Script : Split given month into weeks

I want to split a given month into weeks. For example if I give the date in dd/mm/yy format say 01/02/08 it should give output in the given format : week1 : start date and end date. week2 : "" week3 : "" week4 : "" (5 Replies)
Discussion started by: khushbu_roy
5 Replies

2. Shell Programming and Scripting

Isolating the Month in Perl

munt=`date '+%m` will isolate the month in digit form 02 = Feb Trying to get the same out of perl just cant see it $stimx = localtime($^T); print ((split/ /,$stimx)); (4 Replies)
Discussion started by: popeye
4 Replies

3. UNIX for Dummies Questions & Answers

print previous month (current month minus 1) with Solaris date and ksh

Hi folks month=`date +%m`gives current month Howto print previous month (current month minus 1) with Solaris date and ksh (7 Replies)
Discussion started by: slashdotweenie
7 Replies

4. Shell Programming and Scripting

Script to counting a specific word in a logfile on each day of this month, last month etc

Hello All, I am trying to come up with a shell script to count a specific word in a logfile on each day of this month, last month and the month before. I need to produce this report and email it to customer. Any ideas would be appreciated! (5 Replies)
Discussion started by: pnara2
5 Replies

5. Shell Programming and Scripting

perl : searching for month and storing the date and time in an array

I am writing the code in perl. I have an array in perl and each variable in the array contains the data in the below format Now I need to check the below variable w.r.t system month I need to store the date and time(Tue Aug 7 03:54:12 2012) from the below data into file if contains only 'Aug'... (5 Replies)
Discussion started by: giridhar276
5 Replies

6. Shell Programming and Scripting

Convert From Month Number to Month Name

Hi, I have a script that accepts an input date from the user in yyyy-mm-dd format. I need to get the mm-dd part and convert it to month name. example: 2011-11-15 I want that to become "Nov 15" I don't have the GNU date, I am using an AIX os. Thanks. (1 Reply)
Discussion started by: erin00
1 Replies

7. Shell Programming and Scripting

Need last month files after 10th of every month

Hi, I need all file names in a folder which has date >= 10th of last month, Example : files in folder AUTO_F1_20140610.TXT BUTO_F1_20140616.TXT CUTO_F1_20140603.TXT FA_AUTO_06012014.TXT LA_AUTO_06112014.TXT MA_AUTO_06212014.TXT ZA_AUTO_06232014.TXT Output: AUTO_F1_20140610.TXT... (9 Replies)
Discussion started by: nani1984
9 Replies

8. UNIX for Advanced & Expert Users

To pass one month range in sql script

Hi Guys, i am having .sql script which inserts data from one table to another table based on date condition, i need to pass range on based on how many number of months, for e.g set timing on; whenever sqlerror exit failure; spool myscript.log append accept start_date... (7 Replies)
Discussion started by: rohit_shinez
7 Replies

9. Shell Programming and Scripting

Remove new line and convert Month to Decimal

# Sample input common-name www.test.com.au expiration Dec 21 01:00:31 2017 GMT common-name www.test1.com.au expiration Jan 19 04:41:03 2018 GMT # Desired Output # Field 1: Domain name # Field 2: Date/time converted to Austraian format DD/MM/YYYY and on the same line as Domain Name. #... (7 Replies)
Discussion started by: thangbom
7 Replies

10. Linux

Bash Display First Friday of the next month

Hello, I need to find the date of next first Friday of the month and set as a variable in a bash script ie - FIRSTFRIDAY=$(date -dfirst-friday +%d) I know date -dfirst-friday doesn't work, but unsure if I can use this / cal + awk or something else to find the right date of the... (7 Replies)
Discussion started by: summerdays
7 Replies
ods-timing(5)							OpenDNSSEC timinig						     ods-timing(5)

NAME
ods-timing - OpenDNSSEC timing specification SYNOPSIS
/etc/opendnssec/conf.xml /etc/opendnssec/kasp.xml /etc/opendnssec/zonelist.xml DESCRIPTION
The configuration files of OpenDNSSEC need to have timing descriptions, notably for periods. These descriptions follow ISO 8601 with exceptions for the duration of a month and a year, as these periods would be allowed to vary if ISO 8601 were strictly adhered to. Durations are represented by the format P[n]Y[n]M[n]DT[n]H[n]M[n]S. In these representations, the [n] is replaced by the value for each of the date and time elements that follow the [n]. Leading zeros are not required. The capital letters P, Y, M, W, D, T, H, M and S are desig- nators for each of the date and time elements and are not replaced P is the duration designator (historically called "period") placed at the start of the duration representation. Y is the year designator that follows the value for the number of years. M is the month designator that follows the value for the number of months. W is the week designator that follows the value for the number of weeks. D is the day designator that follows the value for the number of days. T is the time designator that precedes the time components of the representation. H is the hour designator that follows the value for the number of hours. M is the minute designator that follows the value for the number of minutes. S is the second designator that follows the value for the number of seconds. For example, P3Y6M4DT12H30M5S represents a duration of "three years, six months, four days, twelve hours, thirty minutes, and five sec- onds". Date and time elements including their designator may be omitted if their value is zero, and lower order elements may also be omit- ted for reduced precision. For example, P23DT23H and P4Y are both acceptable duration representations. EXCEPTION
A year or month vary in duration depending on the current date. For OpenDNSSEC, we assume fixed values One month is assumed to be 31 days. One year is assumed to be 365 days. This exception may or may not change in future releases of OpenDNSSEC. The reason for making this exception is to avoid complicating this software in a way that may not meet any practical need. SEE ALSO
ods-auditor(1), ods-control(8), ods-enforcerd(8), ods-hsmspeed(1), ods-hsmutil(1), ods-kaspcheck(1), ods-ksmutil(1), ods-signer(8), ods-signerd(8), opendnssec(7), ISO 8601, http://www.opendnssec.org/ AUTHORS
OpenDNSSEC was made by the OpenDNSSEC project, to be found on http://www.opendnssec.org/ OpenDNSSEC February 2010 ods-timing(5)
All times are GMT -4. The time now is 07:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy