Sponsored Content
Top Forums Shell Programming and Scripting Compare date from db2 table to yesterday's Unix system date Post 302188538 by sasaliasim on Wednesday 23rd of April 2008 06:26:20 PM
Old 04-23-2008
Franklin52,

After trying your suggestion, I got the following error:

SQL0183N A datetime arithmetic operation or a datetime scalar function has a result that is not within the valid range of dates. SQLSTATE=22008
 

10 More Discussions You Might Find Interesting

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

2. Shell Programming and Scripting

Need help in Shell Script comparing todays date with Yesterday date from Sysdate

Hi, I want to compare today's date(DDMMYYYY) with yesterday(DDMMYYYY) from system date,if (today month = yesterday month) then execute alter query else do nothing. The above requirement i want in Shell script(KSH)... Can any one please help me? Double post, continued here. (0 Replies)
Discussion started by: kumarmsk1331
0 Replies

3. Shell Programming and Scripting

Adding days to system date then compare to a date

Hi! I am trying to read a file and every line has a specific date as one of its fields. I want to take that date and compare it to the date today plus 6 days. while read line do date=substr($line, $datepos, 8) #date is expected to be YYYYMMDD if ; then ...proceed commands ... (1 Reply)
Discussion started by: kokoro
1 Replies

4. Shell Programming and Scripting

[Solved] Replace yesterday date with today's date except from the first line

Hello, I have a file like this: 2012112920121130 12345620121130msABowwiqiq 34477420121129amABamauee e7748420121130ehABeheheei in case the content of the file has the date of yesterday within the lines containing pattern AB this should be replaced by the current date. But if I use... (3 Replies)
Discussion started by: Lilu_CK
3 Replies

5. Shell Programming and Scripting

How to get tomorrow,yesterday date from date Command

Hi I want to get tomorrow and yesterday date from date command. My shell is KSH and server is AIX. I tried several options, but unable to do. Please help on this. Regards Rajesh (5 Replies)
Discussion started by: rajeshmepco
5 Replies

6. Shell Programming and Scripting

How to append date to filename, but base it on yesterday's date?

Hello, I'd like to write a monthly archive script that archives some logs. But I'd like to do it based on yesterday's date. In other words, I'd like to schedule the script to run on the 1st day of each month, but have the archive filename include the previous month instead. Here's what I... (5 Replies)
Discussion started by: nbsparks
5 Replies

7. Shell Programming and Scripting

Shell script to compare two files of todays date and yesterday's date

hi all, How to compare two files whether they are same are not...? like i had my input files as 20141201_file.txt and 20141130_file2.txt how to compare the above files based on date .. like todays file and yesterdays file...? (4 Replies)
Discussion started by: hemanthsaikumar
4 Replies

8. Shell Programming and Scripting

Compare the system date with date from a text file

I get the date that's inside a text file and assigned it to a variable. When I grep the date from the file, I get this, Not After : Jul 28 14:09:57 2017 GMT So I only crop out the date, with this command echo $dateFile | cut -d ':' -f 2,4The result would be Jul 28 14:57 2017 GMT How do I... (3 Replies)
Discussion started by: Loc
3 Replies

9. UNIX for Beginners Questions & Answers

Compare date in .txt with system date and remove if it's lesser than system date

Can someone help me with the code wherein there is a file f1.txt with different column and 34 column have expiry date and I need to get that and compare with system date and if expiry date is <system date remove those rows and other rows should be moved to new file f2.txt . I don't want to delete... (2 Replies)
Discussion started by: Stuti
2 Replies

10. Answers to Frequently Asked Questions

Compare date in .txt with system date and remove if it's lesser than system date

I m working on shell scripting and I m stuck where in my .txt file there is column as expiry date and I need to compare that date with system date and need to remove all the rows where expiry date is less than system date and create a new .txt with update. (1 Reply)
Discussion started by: Stuti
1 Replies
datetime(3)						     Library Functions Manual						       datetime(3)

NAME
datetime - convert between TAI labels and seconds SYNTAX
#include <datetime.h> void datetime_tai(&dt,t); datetime_sec datetime_untai(&dt); struct datetime dt; datetime_sec t; DESCRIPTION
International Atomic Time, TAI, is the fundamental unit for time measurements. TAI has one label for every second of real time, without complications such as leap seconds. A struct datetime variable, such as dt, stores a TAI label. dt.year is the year number minus 1900; dt.mon is the month number, from 0 (January) through 11 (December); dt.mday is the day of the month, from 1 through 31; dt.hour is the hour, from 0 through 23; dt.min is the minute, from 0 through 59; dt.sec is the second, from 0 through 59; dt.wday is the day of the week, from 0 (Sunday) through 6 (Saturday); dt.yday is the day of the year, from 0 through 365. The datetime library supports more convenient TAI manipulation with the datetime_sec type. A datetime_sec value, such as t, is an integer referring to the tth second after the beginning of 1970 TAI. The first second of 1970 TAI was 0; the next second was 1; the last second of 1969 TAI was -1. The difference between two datetime_sec values is a number of real-time seconds. datetime_tai converts a datetime_sec to a TAI label. datetime_untai reads a TAI label (specifically dt.year, dt.mon, dt.mday, dt.hour, dt.min, and dt.sec) and returns a datetime_sec. SEE ALSO
now(3) datetime(3)
All times are GMT -4. The time now is 07:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy