Sponsored Content
Top Forums Shell Programming and Scripting How to Get 60 days Old date from current date in KSH script Post 302491385 by kshji on Thursday 27th of January 2011 09:30:43 AM
Old 01-27-2011
I have also done page which include two tools and also examples for date calculation:
  • using ksh printf
  • using GNU date
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find a date which is 7 days past when given current date

hii all. I have to get the date of the 7th day past from the current date. if i give the current date as sep 3 then i must get the date as 27th of august. can we get the values from the "cal" command. cal | awk '{print $2}' will this type of command work. actually my need is if today is... (17 Replies)
Discussion started by: ladtony
17 Replies

2. Shell Programming and Scripting

how to get what date was 28 days ago of the current system date IN UNIX

Hi, Anybody knows how to get what date was 28 days ago of the current system date through UNIX script. Ex : - If today is 28th Mar 2010 then I have to delete the files which arrived on 1st Mar 2010, (15 Replies)
Discussion started by: kandi.reddy
15 Replies

3. Shell Programming and Scripting

Date after 5 days from current date in YYYYMMDD format

Hello Experts, How do i get date after 5 days from current date in YYYYMMDD format? How do you compare date in YYYYMMDD format? Thanks (8 Replies)
Discussion started by: needyourhelp10
8 Replies

4. Windows & DOS: Issues & Discussions

Adding or subtracting days from current date in batch script

Hi, I'm writing an batch file to create report In the batch file iam passing two arguments:startdate and finishdate Ex: startdate=07-sep-2009 finishdate=07-sep-2011 I need to have script that takes command line argument as input and gives me out currentdate last year and current date... (2 Replies)
Discussion started by: anand1773
2 Replies

5. Shell Programming and Scripting

Number of days between the current date and user defined date

I am trying to find out the number of days between the current date and user defined date. I took reference from here for the date2jd() function. Modified the function according to my requirement. But its not working properly. Original code from here is working fine. #!/bin/sh... (1 Reply)
Discussion started by: hiten.r.chauhan
1 Replies

6. 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

7. Shell Programming and Scripting

How to display a date, 30 days from the current date?

Well guys, I know the right syntax for displaying the current date is $(date). However, I am planning to send emails to some customers which displays their subscription date, and then the expiry. The expiry being 30 days from the current date. What would the right syntax be? (6 Replies)
Discussion started by: xxxx
6 Replies

8. Shell Programming and Scripting

Seven days past date from current date

hi all.. i want 2 know how 2 find 7days past date from current date.. when i used set datetime = `date '+%m%d%y'` i got 060613.. i just want to know hw to get 053013.. i tried using date functions but couldnt get it :( i use c shell and there is no chance that i can change that ..... (3 Replies)
Discussion started by: Rahul619
3 Replies

9. UNIX for Beginners Questions & Answers

Subscribers with Date 90 days older than current date

I have to display only those subscribers which are in "unconnected state" and the date is 90 days older than today's date. Below command is used for this purpose: cat vfsubscriber_20170817.csv | sed -e 's/^"//' -e '1d' | nawk -F '",' '{if ( (substr($11,2,4) == 2017) && ( substr($11,2,8) -lt... (1 Reply)
Discussion started by: dia
1 Replies

10. 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
FusionInventory::Agent::Tools(3pm)			User Contributed Perl Documentation			FusionInventory::Agent::Tools(3pm)

NAME
FusionInventory::Agent::Tools - OS-independant generic functions DESCRIPTION
This module provides some OS-independant generic functions. FUNCTIONS
getFormatedLocalTime($time) Returns a formated date from given Unix timestamp. getFormatedGmTime($time) Returns a formated date from given Unix timestamp. getFormatedDate($year, $month, $day, $hour, $min, $sec) Returns a formated date from given date elements. getCanonicalManufacturer($manufacturer) Returns a normalized manufacturer value for given one. getCanonicalSpeed($speed) Returns a normalized speed value (in Mhz) for given one. getCanonicalSize($size) Returns a normalized size value (in Mb) for given one. getSanitizedString($string) Returns the input stripped from any control character, properly encoded in UTF-8. compareVersion($major, $minor, $min_major, $min_minor) Returns true if software with given major and minor version meet minimal version requirements. getDirectoryHandle(%params) Returns an open file handle on either a command output, or a file. logger a logger object directory the directory to use getFileHandle(%params) Returns an open file handle on either a command output, a file, or a string. logger a logger object command the command to use file the file to use, as an alternative to the command string the string to use, as an alternative to the command getFirstLine(%params) Returns the first line of given command output or given file content, with end of line removed. logger a logger object command the exact command to use file the file to use, as an alternative to the command getAllLines(%params) Returns all the lines of given command output or given file content, with end of line removed. logger a logger object command the exact command to use file the file to use, as an alternative to the command getFirstMatch(%params) Returns the result of applying given pattern on the first matching line of given command output or given file content. pattern a regexp logger a logger object command the exact command to use file the file to use, as an alternative to the command getLastLine(%params) Returns the last line of given command output or given file content. logger a logger object command the exact command to use file the file to use, as an alternative to the command getLinesCount(%params) Returns the number of lines of given command output or given file content. logger a logger object command the exact command to use file the file to use, as an alternative to the command canRun($binary) Returns true if given binary can be executed. canRead($file) Returns true if given file can be read. canLoad($module) Returns true if given perl module can be loaded (and actually loads it). hex2char($value) Returns the value converted to a character if it starts with hexadecimal prefix, the unconverted value otherwise. Eg. 0x41 -> A, 41 -> 41. hex2dec($value) Returns the value converted to a decimal if it starts with hexadecimal prefix, the unconverted value otherwise. Eg. 0x41 -> 65, 41 -> 41. dec2hex($value) Returns the value converted to an hexadecimal if it doesn't start with hexadecimal prefix, the unconverted value otherwise. Eg. 65 -> 0x41, 0x41 -> 0x41. any BLOCK LIST Returns a true value if any item in LIST meets the criterion given through BLOCK. all BLOCK LIST Returns a true value if all items in LIST meet the criterion given through BLOCK. none BLOCK LIST Returns a true value if no item in LIST meets the criterion given through BLOCK. uniq BLOCK LIST Returns a new list by stripping duplicate values in LIST. file2module($string) Converts a perl file name to a perl module name (Foo/Bar.pm -> Foo::Bar) module2file($string) Converts a perl module name to a perl file name ( Foo::Bar -> Foo/Bar.pm) runFunction(%params) Run a function whose name is computed at runtime and return its result. logger a logger object module the function namespace function the function name timeout timeout for function execution load enforce module loading first delay($second) Wait for $second. It uses sleep() or Win32::Sleep() depending on the Operating System. perl v5.14.2 2012-06-25 FusionInventory::Agent::Tools(3pm)
All times are GMT -4. The time now is 07:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy