10 More Discussions You Might Find Interesting
1. HP-UX
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
2. UNIX for Beginners Questions & Answers
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)
Discussion started by: dia
1 Replies
3. Shell Programming and Scripting
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)
Discussion started by: Rahul619
3 Replies
4. Shell Programming and Scripting
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)
Discussion started by: xxxx
6 Replies
5. Shell Programming and Scripting
Hi,
I want to subtract 'n' days from the current timestamp in a k shell script. Is there any inbuilt function to do it
or any workaround solution to get the date. And I want the output to be in YYYY:MM:DD HH:MM:SS format. Please help.
Thanks in advance. (4 Replies)
Discussion started by: Suryaaravindh
4 Replies
6. Shell Programming and Scripting
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)
Discussion started by: hiten.r.chauhan
1 Replies
7. Windows & DOS: Issues & Discussions
Hi,
I'm writing an batch file to create report
In the batch file iam passing two arguments:startdate and finishdate
Ex: startdate=07-sep-2009 finishdate=07-sep-2011
I need to have script that takes command line argument as input and gives me out currentdate last year and current date... (2 Replies)
Discussion started by: anand1773
2 Replies
8. Shell Programming and Scripting
Hello Experts,
How do i get date after 5 days from current date in YYYYMMDD format?
How do you compare date in YYYYMMDD format?
Thanks (8 Replies)
Discussion started by: needyourhelp10
8 Replies
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
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)
Discussion started by: ladtony
17 Replies
Image::ExifTool::Shift(3pm) User Contributed Perl Documentation Image::ExifTool::Shift(3pm)
NAME
Image::ExifTool::Shift.pl - ExifTool time shifting routines
DESCRIPTION
This module contains routines used by ExifTool to shift date and time values.
DETAILS
Time shifts are applied to standard EXIF-formatted date/time values (ie. "2005:03:14 18:55:00"). Date-only and time-only values may also
be shifted, and an optional timezone (ie. "-05:00") is also supported. Here are some general rules and examples to explain how shift
strings are interpreted:
Date-only values are shifted using the following formats:
'Y:M:D' - shift date by 'Y' years, 'M' months and 'D' days
'M:D' - shift months and days only
'D' - shift specified number of days
Time-only values are shifted using the following formats:
'h:m:s' - shift time by 'h' hours, 'm' minutes and 's' seconds
'h:m' - shift hours and minutes only
'h' - shift specified number of hours
Timezone shifts are specified in the following formats:
'+h:m' - shift timezone by 'h' hours and 'm' minutes
'-h:m' - negative shift of timezone hours and minutes
'+h' - shift timezone hours only
'-h' - negative shift of timezone hours only
A valid shift value consists of one or two arguments, separated by a space. If only one is provided, it is assumed to be a time shift when
applied to a time-only or a date/time value, or a date shift when applied to a date-only value. For example:
'7' - shift by 1 hour if applied to a time or date/time
value, or by one day if applied to a date value
'2:0' - shift 2 hours (time, date/time), or 2 months (date)
'5:0:0' - shift 5 hours (time, date/time), or 5 years (date)
'0:0:1' - shift 1 s (time, date/time), or 1 day (date)
If two arguments are given, the date shift is first, followed by the time shift:
'3:0:0 0' - shift date by 3 years
'0 15:30' - shift time by 15 hours and 30 minutes
'1:0:0 0:0:0+5:0' - shift date by 1 year and timezone by 5 hours
A date shift is simply ignored if applied to a time value or visa versa.
Numbers specified in shift fields may contain a decimal point:
'1.5' - 1 hour 30 minutes (time, date/time), or 1 day (date)
'2.5 0' - 2 days 12 hours (date/time), 12 hours (time) or
2 days (date)
And to save typing, a zero is assumed for any missing numbers:
'1::' - shift by 1 hour (time, date/time) or 1 year (date)
'26:: 0' - shift date by 26 years
'+:30 - shift timezone by 30 minutes
Below are some specific examples applied to real date and/or time values ('Dir' is the applied shift direction: '+' is positive, '-' is
negative):
Original Value Shift Dir Shifted Value
--------------------- ------- --- ---------------------
'20:30:00' '5' + '01:30:00'
'2005:01:27' '5' + '2005:02:01'
'11:54:00' '2.5 0' - '23:54:00'
'2005:11:02' '2.5 0' - '2005:10:31'
'2005:11:02 11:54:00' '2.5 0' - '2005:10:30 23:54:00'
'2004:02:28 08:00:00' '1 1.3' + '2004:02:29 09:18:00'
'07:00:00' '-5' + '07:00:00'
'07:00:00+01:00' '-5' + '07:00:00-04:00'
'07:00:00Z' '+2:30' - '07:00:00-02:30'
'1970:01:01' '35::' + '2005:01:01'
'2005:01:01' '400' + '2006:02:05'
'10:00:00.00' '::1.33' + '09:59:58.67'
NOTES
The format of the original date/time value is not changed when the time shift is applied. This means that the length of the date/time
string will not change, and only the numbers in the string will be modified. The only exception to this rule is that a 'Z' timezone is
changed to '+00:00' notation if a timezone shift is applied. A timezone will not be added to the date/time string.
TRICKY
This module is perhaps more complicated than it needs to be because it is designed to be very flexible in the way time shifts are specified
and applied...
The ability to shift dates by Y years, M months, etc, is somewhat contradictory to the goal of maintaining a constant shift for all time
values when applying a batch shift. This is because shifting by 1 month can be equivalent to anything from 28 to 31 days, and 1 year can
be 365 or 366 days, depending on the starting date.
The inconsistency is handled by shifting the first tag found with the actual specified shift, then calculating the equivalent time
difference in seconds for this shift and applying this difference to subsequent tags in a batch conversion. So if it works as designed,
the behaviour should be both intuitive and mathematically correct, and the user shouldn't have to worry about details such as this (in
keeping with Perl's "do the right thing" philosophy).
BUGS
This feature uses the standard time library functions, which typically are limited to dates in the range 1970 to 2038.
AUTHOR
Copyright 2003-2011, Phil Harvey (phil at owl.phy.queensu.ca)
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Image::ExifTool(3pm)
perl v5.12.4 2011-03-20 Image::ExifTool::Shift(3pm)