Sponsored Content
Top Forums Shell Programming and Scripting Subtract months/days from date Post 302914579 by Corona688 on Tuesday 26th of August 2014 06:21:20 PM
Old 08-26-2014
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Subtract 2 months from the date

I have the script which appends month and year to the name of the file. Now every time when I append the month-year combination I have to subtract 2 months from the current date and then append it, since we are sending our vendor 2 months prior worth of data eveytime. #! /usr/bin/ksh ... (5 Replies)
Discussion started by: mahekr2000
5 Replies

2. Shell Programming and Scripting

How to get date n months before in Unix?

Hi, I need the date n months before currrent date I need to store date in a varible say x and then get the date 6 month before and get the result in the format 25-Aug-2009 Please Advice (7 Replies)
Discussion started by: mad_man12
7 Replies

3. Shell Programming and Scripting

Subtract days from a variable holding date

Hi, could someone help on this.. I have a date in variable procdate="05/30/2009" I would want to Subtract it with 3 or 4 (2 Replies)
Discussion started by: infernalhell
2 Replies

4. UNIX for Advanced & Expert Users

Subtract days to a date in AIX 5.3

good afternoon, can someone help me, I need to make a script where n subtract days to a date. I am using AIX 5.3. Greetings. (4 Replies)
Discussion started by: systemoper
4 Replies

5. Shell Programming and Scripting

Subtract 2 date columns in .csv file and get output as number of days

Hi, I have one .csv file. I have 2 date columns present in file, column 2 and column 3. I need to calculate how many days exist between 2 dates. I am trying to subtract date column 2 from date column 3. Eg: my file look likes s.no, Start_date,End_Date 1, 7/29/2012,10/27/2012 2,... (9 Replies)
Discussion started by: Dimple
9 Replies

6. Solaris

Subtract 2 days from timestamp

Hi, I am running on Solaris 11.3. I have a timestamp in this format date +%Y%m%d%H%M . I found some forums saying to use date --d however that didn't work. Is there a way how I can subtract days from timestamp in that format? Thanks (12 Replies)
Discussion started by: nms
12 Replies

7. Shell Programming and Scripting

Get a given date and subtract it to 5 days ago

Hi all, I have been researching to obtain SSL certification expiry for most of our webistes. For some cases, some hosts where not directly accessible so i finally got a solution working with curl using my proxy. This lists the expiry date which i'm finally looking for. # curl --proxy... (4 Replies)
Discussion started by: nms
4 Replies

8. Shell Programming and Scripting

Subtract a file's modification date with current date

SunOS -s 5.10 Generic_147440-04 sun4u sparc SUNW,SPARC-Enterprise Hi, In a folder, there are files. I have a script which reads the current date and subtract the modification date of each file. How do I achieve this? Regards, Joe (2 Replies)
Discussion started by: roshanbi
2 Replies

9. HP-UX

awk command in hp UNIX subtract 30 days automatically from current date without date illegal option

current date command runs well awk -v t="$(date +%Y-%m-%d)" -F "'" '$1 < t' myname.dat subtract 30 days fails awk -v t="$(date --date="-30days" +%Y-%m-%d)" -F "'" '$1 < t' myname.dat awk command in hp unix subtract 30 days automatically from current date without date illegal option error... (20 Replies)
Discussion started by: kmarcus
20 Replies
std::fpos< _StateT >(3) 				     Library Functions Manual					   std::fpos< _StateT >(3)

NAME
std::fpos< _StateT > - SYNOPSIS
Public Member Functions fpos (streamoff __off) operator streamoff () const fpos operator+ (streamoff __off) const fpos & operator+= (streamoff __off) fpos operator- (streamoff __off) const streamoff operator- (const fpos &__other) const fpos & operator-= (streamoff __off) void state (_StateT __st) _StateT state () const Detailed Description template<typename _StateT>class std::fpos< _StateT > Class representing stream positions. The standard places no requirements upon the template parameter StateT. In this implementation StateT must be DefaultConstructible, CopyConstructible and Assignable. The standard only requires that fpos should contain a member of type StateT. In this implementation it also contains an offset stored as a signed integer. Parameters: StateT Type passed to and returned from state(). Definition at line 112 of file postypes.h. Constructor &; Destructor Documentation template<typename _StateT> std::fpos< _StateT >::fpos (streamoff__off) [inline] Construct position from offset. Definition at line 133 of file postypes.h. Member Function Documentation template<typename _StateT> std::fpos< _StateT >::operator streamoff () const [inline] Convert to streamoff. Definition at line 137 of file postypes.h. template<typename _StateT> fpos std::fpos< _StateT >::operator+ (streamoff__off) const [inline] Add position and offset. Definition at line 178 of file postypes.h. template<typename _StateT> fpos& std::fpos< _StateT >::operator+= (streamoff__off) [inline] Add offset to this position. Definition at line 154 of file postypes.h. template<typename _StateT> fpos std::fpos< _StateT >::operator- (streamoff__off) const [inline] Subtract offset from position. Definition at line 192 of file postypes.h. template<typename _StateT> streamoff std::fpos< _StateT >::operator- (const fpos< _StateT > &__other) const [inline] Subtract position to return offset. Definition at line 205 of file postypes.h. template<typename _StateT> fpos& std::fpos< _StateT >::operator-= (streamoff__off) [inline] Subtract offset from this position. Definition at line 165 of file postypes.h. template<typename _StateT> void std::fpos< _StateT >::state (_StateT__st) [inline] Remember the value of st. Definition at line 141 of file postypes.h. template<typename _StateT> _StateT std::fpos< _StateT >::state () const [inline] Return the last set value of st. Definition at line 146 of file postypes.h. Author Generated automatically by Doxygen for libstdc++ from the source code. libstdc++ Tue Jun 10 2014 std::fpos< _StateT >(3)
All times are GMT -4. The time now is 05:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy