The following DIBOL program is a re hash of a program published in Computer World Newspaper in the early 1970's. The original was written in Fortran
It converts a date in the format yyyymmdd into the number days that have elapsed since Jan 1 1900.
It also converts a number representing the number of days since Jan 1 1900 to a 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)
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)
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)
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)
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 CENTOS
template::plugin::date
Template::Plugin::Date(3) User Contributed Perl Documentation Template::Plugin::Date(3)NAME
Template::Plugin::Date - Plugin to generate formatted date strings
SYNOPSIS
[% USE date %]
# use current time and default format
[% date.format %]
# specify time as seconds since epoch
# or as a 'h:m:s d-m-y' or 'y-m-d h:m:s' string
[% date.format(960973980) %]
[% date.format('4:20:36 21/12/2000') %]
[% date.format('2000/12/21 4:20:36') %]
# specify format
[% date.format(mytime, '%H:%M:%S') %]
# specify locale
[% date.format(date.now, '%a %d %b %y', 'en_GB') %]
# named parameters
[% date.format(mytime, format = '%H:%M:%S') %]
[% date.format(locale = 'en_GB') %]
[% date.format(time = date.now,
format = '%H:%M:%S',
locale = 'en_GB) %]
# specify default format to plugin
[% USE date(format = '%H:%M:%S', locale = 'de_DE') %]
[% date.format %]
...
DESCRIPTION
The "Date" plugin provides an easy way to generate formatted time and date strings by delegating to the "POSIX" "strftime()" routine.
The plugin can be loaded via the familiar USE directive.
[% USE date %]
This creates a plugin object with the default name of '"date"'. An alternate name can be specified as such:
[% USE myname = date %]
The plugin provides the "format()" method which accepts a time value, a format string and a locale name. All of these parameters are
optional with the current system time, default format ('"%H:%M:%S %d-%b-%Y"') and current locale being used respectively, if undefined.
Default values for the time, format and/or locale may be specified as named parameters in the "USE" directive.
[% USE date(format = '%a %d-%b-%Y', locale = 'fr_FR') %]
When called without any parameters, the "format()" method returns a string representing the current system time, formatted by "strftime()"
according to the default format and for the default locale (which may not be the current one, if locale is set in the "USE" directive).
[% date.format %]
The plugin allows a time/date to be specified as seconds since the epoch, as is returned by "time()".
File last modified: [% date.format(filemod_time) %]
The time/date can also be specified as a string of the form "h:m:s d/m/y" or "y/m/d h:m:s". Any of the characters : / - or space may be
used to delimit fields.
[% USE day = date(format => '%A', locale => 'en_GB') %]
[% day.format('4:20:00 9-13-2000') %]
Output:
Tuesday
A format string can also be passed to the "format()" method, and a locale specification may follow that.
[% date.format(filemod, '%d-%b-%Y') %]
[% date.format(filemod, '%d-%b-%Y', 'en_GB') %]
A fourth parameter allows you to force output in GMT, in the case of seconds-since-the-epoch input:
[% date.format(filemod, '%d-%b-%Y', 'en_GB', 1) %]
Note that in this case, if the local time is not GMT, then also specifying '%Z' (time zone) in the format parameter will lead to an
extremely misleading result.
Any or all of these parameters may be named. Positional parameters should always be in the order "($time, $format, $locale)".
[% date.format(format => '%H:%M:%S') %]
[% date.format(time => filemod, format => '%H:%M:%S') %]
[% date.format(mytime, format => '%H:%M:%S') %]
[% date.format(mytime, format => '%H:%M:%S', locale => 'fr_FR') %]
[% date.format(mytime, format => '%H:%M:%S', gmt => 1) %]
...etc...
The "now()" method returns the current system time in seconds since the epoch.
[% date.format(date.now, '%A') %]
The "calc()" method can be used to create an interface to the "Date::Calc" module (if installed on your system).
[% calc = date.calc %]
[% calc.Monday_of_Week(22, 2001).join('/') %]
The "manip()" method can be used to create an interface to the "Date::Manip" module (if installed on your system).
[% manip = date.manip %]
[% manip.UnixDate("Noon Yesterday","%Y %b %d %H:%M") %]
AUTHORS
Thierry-Michel Barral wrote the original plugin.
Andy Wardley provided some minor fixups/enhancements, a test script and documentation.
Mark D. Mills cloned "Date::Manip" from the "Date::Calc" sub-plugin.
COPYRIGHT
Copyright (C) 2000-2007 Thierry-Michel Barral, Andy Wardley.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Template::Plugin, POSIX
perl v5.16.3 2012-01-13 Template::Plugin::Date(3)