Well, 'date' is just a program file, you can get a Gnu date and call it gdate or by path.
I wrote tm2tm as a more task oriented tool than date, not cluttered with clock setting. It is easy to compile and use. In this case, time input is clock, delta is back one day, format is YYYY-MM-DD:
Last edited by DGPickett; 02-13-2015 at 06:34 PM..
Hello, using date, we can easily get today's date
$ date +%y-%m-%d
06-12-08
is it possible for me to get yesterday's date using 'date', if not, is there any quick and easy way to do that?
Thanks! (1 Reply)
I am not using GNU nor BSD. On AIX, how do you return yesterday in the format of i.e. "May 09" with a space.
# `TZ=y380 date +%h""%d`
>> May09
# `TZ=y380 date +%h" "%d`
>> May
I appreciate your help in advance.
thx (3 Replies)
I haven't been using linux very long( and when I say that its only been about 1 week for me) I was told to do the following:
Create a Bash script that will copy all the files and subdirectories in one directory to a newly created directory. You may name the receiving directory anything you like.... (4 Replies)
I am currently running the following Korn shell script which works fine:
#!/usr/bin/ksh
count=`db2 -x "select count(*) from schema.tablename"`
echo "count"
I would like to add a "where" clause to the 2nd line that would allow me to get a record count of all the records from schema.tablename... (9 Replies)
I was playing to find a simple way to get yesterday's date, and came up with this (on an AIX 5.2 box):
$ date
Thu Feb 19 11:21:26 EST 2009
$ echo $TZ
EST5EDT
$ yesterday=`TZ=$(date +%Z)+24 date`
$ echo $yesterday
Wed Feb 18 16:21:52 GMT 2009
Why it is converted to GMT instead of... (2 Replies)
HI All,
I am trying so long to find the yesterday's date to run a script but i failed
kinldy share the command to find yesterday's date in ksh
i tried with
date --date='1 day ago'
but it displaying error
your help will highly apeerciated.
Thanks (7 Replies)
hi guys
i want to know how can i insert in a variable yesterday for example :
today=`date +%Y%m%d`
yesterday =???
thanks a lot
Please use CODE tags as required by forum rules! (4 Replies)
HI Team,
I am trying to create a shell script to generate a yesterday and today report to compare and email in daily basis. can you please help me on the same.
#!/bin/bash
#Author: *******************
#Description: This script will return the following set of system information:
... (2 Replies)
Discussion started by: Mi4304
2 Replies
LEARN ABOUT DEBIAN
alevt-date
ALEVT-DATE(1) Teletext time ALEVT-DATE(1)NAME
alevt-date - display/set time received via Teletext
SYNOPSIS
alevt-date [options]
DESCRIPTION
alevt-date displays the time received from a Teletext source. It can be used to set the system time. The date is not interpreted (not
even transmitted on most channels). So it allows only adjustment of +/-12 hours. The default allowed adjustment is limited to +/-2 hours
(use -delta to change). Without the -set option it just displays the date in the format of the date(1) command.
OPTIONS
A summary of options is included below.
-set Set system time from time received via Teletext.
-delta seconds Maximum allowed adjustment made to the system time. The default is 7200 seconds (2 hours) and the maximum that may be
given is 12 hours.
-format string Format string to used to print the time. Look at strftime(3) for possible control sequences.
-vbi device Use the given device name. Default: /dev/vbi, /dev/vbi0, /dev/video0, /dev/dvb/adapter0/demux0 tried in this order.
-timeout seconds If the time can't be detected in seconds, the program is terminated with a SIGALRM.
-progname name Specifies the program name if using the DVB interface.
-pid pid Specifies the teletext PID if using the DVB interface.
--help Show summary of options.
--version Show version of program.
Before starting this program, you have to set the TV channel with another program like xawtv of set-tv.
Note: This program does not set the battery backed up clock of your computer. clock -w will do this.
The -progname or -pid option specifies the program or teletext PID if using the DVB interface.
If neither of these two options is used, alevt outputs informations about the currently accessible streams and uses the first of these PIDs
as default. This output contains the PIDs and names that can be used as an input for the -progname or -pid option in the context of the
currently chosen TV channel.
FILES
/dev/vbi*
/dev/dvb/adapter*/demux*
SEE ALSO alevt(1x), alevt-cap(1), strftime(3), date(1), clock(8).
BUGS
This program is just a toy. The time transmitted by the TV stations is more than inaccurate. Some are within a few seconds of your local
time reference but others are more then 15 minutes off. You've been warned. (And don't assume the pkt8/30 time is better. It's even
worse.)
No bug reports to <froese@gmx.de> *g*.
LINUX 1.6.2 ALEVT-DATE(1)