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)
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)
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)
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)
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)
To delete log files content older than 30 days and append the lastest date log file date in the respective logs
I want to write a shell script that deletes all log files content older than 30 days and append the lastest log file date in the respective logs
This is my script
cd... (2 Replies)
Hi All,
how to get 2 days Old date from current date in shell shell scripting not Perl scripting.
example-toady's date is 01-April-2013
Expected result will be -30-Mar-2013
please consider Leap year and Feb 28 month also.
Thanks,
Krupa (7 Replies)
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)
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
LEARN ABOUT REDHAT
date::format
Date::Format(3) User Contributed Perl Documentation Date::Format(3)NAME
Date::Format - Date formating subroutines
SYNOPSIS
use Date::Format;
@lt = localtime(time);
print time2str($template, time);
print strftime($template, @lt);
print time2str($template, time, $zone);
print strftime($template, @lt, $zone);
print ctime(time);
print asctime(@lt);
print ctime(time, $zone);
print asctime(@lt, $zone);
DESCRIPTION
This module provides routines to format dates into ASCII strings. They correspond to the C library routines "strftime" and "ctime".
time2str(TEMPLATE, TIME [, ZONE])
"time2str" converts "TIME" into an ASCII string using the conversion specification given in "TEMPLATE". "ZONE" if given specifies the
zone which the output is required to be in, "ZONE" defaults to your current zone.
strftime(TEMPLATE, TIME [, ZONE])
"strftime" is similar to "time2str" with the exception that the time is passed as an array, such as the array returned by "localtime".
ctime(TIME [, ZONE])
"ctime" calls "time2str" with the given arguments using the conversion specification "%a %b %e %T %Y
"
asctime(TIME [, ZONE])
"asctime" calls "time2str" with the given arguments using the conversion specification "%a %b %e %T %Y
"
MULTI-LANGUAGE SUPPORT
Date::Format is capable of formating into several languages, these are English, French, German and Italian. Changing the language is done
via a static method call, for example
Date::Format->language('German');
will change the language in which all subsequent dates are formatted.
This is only a first pass, I am considering changing this to be
$lang = Date::Language->new('German');
$lang->time2str("%a %b %e %T %Y
", time);
I am open to suggestions on this.
CONVERSION SPECIFICATION
Each conversion specification is replaced by appropriate characters as described in the following list. The appropriate
characters are determined by the LC_TIME category of the program's locale.
%% PERCENT
%a day of the week abbr
%A day of the week
%b month abbr
%B month
%c MM/DD/YY HH:MM:SS
%C ctime format: Sat Nov 19 21:05:57 1994
%d numeric day of the month, with leading zeros (eg 01..31)
%e numeric day of the month, without leading zeros (eg 1..31)
%D MM/DD/YY
%h month abbr
%H hour, 24 hour clock, leading 0's)
%I hour, 12 hour clock, leading 0's)
%j day of the year
%k hour
%l hour, 12 hour clock
%L month number, starting with 1
%m month number, starting with 01
%M minute, leading 0's
%n NEWLINE
%o ornate day of month -- "1st", "2nd", "25th", etc.
%p AM or PM
%P am or pm (Yes %p and %P are backwards :)
%q Quarter number, starting with 1
%r time format: 09:05:57 PM
%R time format: 21:05
%s seconds since the Epoch, UCT
%S seconds, leading 0's
%t TAB
%T time format: 21:05:57
%U week number, Sunday as first day of week
%w day of the week, numerically, Sunday == 0
%W week number, Monday as first day of week
%x date format: 11/19/94
%X time format: 21:05:57
%y year (2 digits)
%Y year (4 digits)
%Z timezone in ascii. eg: PST
%z timezone in format -/+0000
%d, %e, %H, %I, %j, %k, %l, %m, %M, %q, %y and %Y can be output in Roman numerals by prefixing the letter with "O", e.g. %OY will output
the year as roman numerals.
AUTHOR
Graham Barr <gbarr@pobox.com>
COPYRIGHT
Copyright (c) 1995-1999 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.
perl v5.8.0 2002-03-07 Date::Format(3)