It's easy as pie to get the date minus one day on opensolaris:
run this command on our crappy Solaris 10 machines however (which I'm guessing doesn't have GNU date running on it) and you get:
This is so so annoying. I can't put GNU date on these unix machines, so how can I get the date -1 day?
Cheers
---------- Post updated at 01:37 PM ---------- Previous update was at 01:21 PM ----------
nevermind... this does it...
Last edited by Yogesh Sawant; 04-09-2011 at 08:02 AM..
Reason: corrected a typo in the subject
Hi,
I have a date input in MMDDYYYY format..
I have to give the day (whether that DD is sunday/monday...)
Is there any command for it...
Or do I have to write a script for that...
Thanks in Advance
Yeheya (1 Reply)
Hi, I have been trying just about every unix command to come up with yesterday's date (today's date - 1). I have seen all of the help on this forum, and none of it seems to work for me here. We are using Sun Solaris 9 Unix. I am using this script to create a .txt file with ftp commands that I will... (2 Replies)
Hi guys,
I had a scenario...
1. I had to get the previous days date in yyyymmdd format
2. i had to create a file with Date inthe format yyyymmdd.txt format
both are different
thanks guys in advance.. (4 Replies)
Dear all,
I have 2 questions.
I have a file with many rows which has date of the format YYYYMMDD.
1. I need to change the date to that weeks friday date(Ex: 20120716(monday) to 20120720). Satuday/Sunday has to be changed to next week friday date too.
2. After converting the date to... (10 Replies)
Hi All,
I have a file in the following format.I need to pick up 25th field which is a date and convert it into a day and add it as a field in the file.
"AAGENAS,PEARL... (3 Replies)
I need to get the next day's date of the user entered date
for example:
Enter date (yyyy/mm/yy):
2013/10/08I need to get the next day's date of the user entered date
Desired Output:
2013/10/09Though there are ways to achieve this is Linux or Unix environment (date command) ,I need to... (1 Reply)
Hi Team,
We have a requirement as follows.
If a date 20141220 as parameter to the script, then the script has to return the output as 20141219.
i.e given date - 1.
The requirement is simple. But it should satisfy leap year, the months having 31 and 30 days, the date in which day light... (9 Replies)
i try to set linux date & time in specific format but it keep giving me error
Example :
date "+%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01"
or
date +"%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01"
keep giving me this error :
date: invalid date ‘19-01-2017 00:05:01'
Please use CODE tags... (7 Replies)
I Have text like
XXX_20190908.csv.gz need to replace Only date in this format with current date every day
Thanks! (1 Reply)
Discussion started by: yamasani1991
1 Replies
LEARN ABOUT BSD
date
DATE(1) General Commands Manual DATE(1)NAME
date - print and set the date
SYNOPSIS
date [-nu] [-d dst] [-t timezone] [yymmddhhmm [.ss] ]
DESCRIPTION
If no arguments are given, the current date and time are printed. Providing an argument will set the desired date; only the superuser can
set the date. The -d and -t flags set the kernel's values for daylight savings time and minutes west of GMT. If dst is non-zero, future
calls to gettimeofday(2) will return a non-zero tz_dsttime. Timezone provides the number of minutes returned by future calls to gettimeof-
day(2) in tz_minuteswest. The -u flag is used to display or set the date in GMT (universal) time. yy represents the last two digits of
the year; the first mm is the month number; dd is the day number; hh is the hour number (24 hour system); the second mm is the minute num-
ber; .ss is optional and represents the seconds. For example:
date 8506131627
sets the date to June 13 1985, 4:27 PM. The year, month and day may be omitted; the default values will be the current ones. The system
operates in GMT. Date takes care of the conversion to and from local standard and daylight-saving time.
If timed(8) is running to synchronize the clocks of machines in a local area network, date sets the time globally on all those machines
unless the -n option is given.
FILES
/usr/adm/wtmp to record time-setting. In /usr/adm/messages, date records the name of the user setting the time.
SEE ALSO gettimeofday(2), utmp(5), timed(8),
TSP: The Time Synchronization Protocol for UNIX 4.3BSD, R. Gusella and S. Zatti
DIAGNOSTICS
Exit status is 0 on success, 1 on complete failure to set the date, and 2 on successfully setting the local date but failing globally.
Occasionally, when timed synchronizes the time on many hosts, the setting of a new time value may require more than a few seconds. On
these occasions, date prints: `Network time being set'. The message `Communication error with timed' occurs when the communication between
date and timed fails.
BUGS
The system attempts to keep the date in a format closely compatible with VMS. VMS, however, uses local time (rather than GMT) and does not
understand daylight-saving time. Thus, if you use both UNIX and VMS, VMS will be running on GMT.
4th Berkeley Distribution March 24, 1987 DATE(1)