Regarding Date caluclation


 
Thread Tools
Contact Us Forum Support Area for Unregistered Users & Account Problems Regarding Date caluclation
# 1  
Old 05-13-2008
Regarding Date caluclation

Thanks for you help regarding Date caluclation script.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

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

3. Shell Programming and Scripting

Date: invalid date trying to set Linux date in specific format

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)
Discussion started by: umen
7 Replies

4. Shell Programming and Scripting

Script to determine Date,TotalFile,total size of file based on date

I have file listed like below -rw-r--r--+ 1 test test 17M Nov 26 14:43 test1.gz -rw-r--r--+ 1 test test 0 Nov 26 14:44 test2.gz -rw-r--r--+ 1 test test 0 Nov 27 10:41 test3.gz -rw-r--r--+ 1 test test 244K Nov 27 10:41 test4.gz -rw-r--r--+ 1 test test 17M Nov 27 10:41 test5.gz I... (5 Replies)
Discussion started by: krish2014
5 Replies

5. Shell Programming and Scripting

Converting a date to friday date and finding Min/Max date

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)
Discussion started by: 2001.arun
10 Replies

6. Shell Programming and Scripting

Check if a date field has date or timestamp or date&timestamp

Hi, In a field, I should receive the date with time stamp in a particular field. But sometimes the vendor sends just the date or the timestamp or correctl the date&timestamp. I have to figure out the the data is a date or time stamp or date&timestamp. If it is date then append "<space>00:00:00"... (1 Reply)
Discussion started by: machomaddy
1 Replies

7. Shell Programming and Scripting

finding date numeral from file and check the validity of date format

hi there I have file names in different format as below triss_20111117_fxcb.csv triss_fxcb_20111117.csv xpnl_hypo_reu_miplvdone_11172011.csv xpnl_hypo_reu_miplvdone_11-17-2011.csv xpnl_hypo_reu_miplvdone_20111117.csv xpnl_hypo_reu_miplvdone_20111117xfb.csv... (10 Replies)
Discussion started by: manas_ranjan
10 Replies

8. UNIX for Dummies Questions & Answers

Delete a row from a file if one column containing a date is greater than the current system date

Hello gurus, I am hoping someone can help me with the required code/script to make this work. I have the following file with records starting at line 4: NETW~US60~000000000013220694~002~~IT~USD~2.24~20110201~99991231~01~01~20101104~... (4 Replies)
Discussion started by: chumsky
4 Replies

9. Shell Programming and Scripting

Date One Week Ago From Given Date, Not From Current Date

Hi all, I've used various scripts in the past to work out the date last week from the current date, however I now have a need to work out the date 1 week from a given date. So for example, if I have a date of the 23rd July 2010, I would like a script that can work out that one week back was... (4 Replies)
Discussion started by: Donkey25
4 Replies

10. Shell Programming and Scripting

How to increment a user defined date value in the DATE format itself using shell script?

I need to increment a date value through shell script. Input value consist of start date and end date in DATE format of unix. For eg. I need increment a date value of 1/1/09 to 31/12/09 i.e for a whole yr. The output must look like 1/1/09 2/2/09 . . . 31/1/09 . . 1/2/09 . 28/2/09... (1 Reply)
Discussion started by: sunil087
1 Replies
Login or Register to Ask a Question
Date::Manip::Obj(3pm)					User Contributed Perl Documentation				     Date::Manip::Obj(3pm)

NAME
Date::Manip::Obj - Base class for Date::Manip objects SYNOPSIS
The Date::Manip::Obj class is the base class used for the following Date::Manip classes: Date::Manip::Base Date::Manip::TZ Date::Manip::Date Date::Manip::Delta Date::Manip::Recur This module is not intended to be called directly and performs no useful function by itself. Instead, use the various derived classes which inherit from it. DESCRIPTION
This module contains a set of methods used by all Date::Manip classes listed above. You should be familiar with the Date::Manip::Objects and Date::Manip::Config documentation. In the method descriptions below, Date::Manip::Date objects will usually be used as examples, but (unless otherwise stated), all of the classes listed above have the same methods, and work in the same fashion. METHODS FOR CREATING OBJECTS
In the examples below, any $date ($date, $date1, $date2, ...) variable is a Date::Manip::Date object. Similarly, $delta, $recur, $tz, and $base refer to objects in the appropriate class. Any $obj variable refers to an object in any of the classes. new There are two ways to use the new method. They are: $obj2 = new CLASS ($obj1,$string,@opts); $obj2 = $obj1->new($string,@opts) In both cases, all arguments are optional. Here, CLASS is the class of the new object. For example: $date = new Date::Manip::Date; $delta = new Date::Manip::Delta; if $obj1 is available, the new object will share as much information from the old object as possible. The class of the new object may be derived from the old object as well. For example, if you call either of these: $date2 = new Date::Manip::Date $date1; $date2 = $date1->new(); the new date object will use the same embedded Date::Manip::TZ object. In the second case, the class of the new object ($date2) is Date::Manip::Date because that is the class of the original object. When specifying CLASS and including an old object, objects do not need to be of the same class. For example, the following are all valid: $date = new Date::Manip::Date $delta; $date = new Date::Manip::Date $tz; You can even do: $date = new Date::Manip::Date $base; but this will have to create a completely new Date::Manip::TZ object, which means that optimal performance may not be achieved if a Date::Manip::TZ object already exists. There are two special cases. Either of the following will create a new Date::Manip::Base object for handling multiple configurations: $base2 = new Date::Manip::Base $base1; $base2 = $base1->new(); Either of the following will create a new Date::Manip::TZ object with the same Date::Manip::Base object embedded in it: $tz2 = new Date::Manip::TZ $tz1; $tz2 = $tz1->new(); The new base object will initially have the same configuration as the original base object, but changing it's configuration will not affect the original base object. If the @opts argument is passed in, it is a list reference containing a list suitable for passing to the config method (described below). In this case, a new Date::Manip::Base object (and perhaps Date::Manip::TZ object) will be created. The new Base object will start as identical to the original one (if a previously defined object was used to create the new object) with the additional options in @opts added. In other words, the following are equivalent: $date = new Date::Manip::Date $obj,@opts; $base = $obj->base(); $base2 = $base->new(); $date = new Date::Manip::Date $base2; $date->config(@opts); It should be noted that the options are applied to the NEW object, not the old one. That only matters in one situation: $base2 = new Date::Manip::Base $base1,@opts; $base2 = $base1->new(@opts); An optional string ($string) may be passed in only when creating a Date::Manip::Date, Date::Manip::Delta, or Date::Manip::Recur object. If it is passed in when creating a Date::Manip::TZ or Date::Manip::Base object, a warning will be issued, but execution will continue. If the string is included, it will be parsed to give an initial value to the object. This will only be done AFTER any options are handled, so the following are equivalent: $date = new Date::Manip::Date $string,@opts; $date = new Date::Manip::Date; $date->config(@opts); $date->parse($string); Note that it is generally not a good idea to pass in $string since all of the parse methods allow (but do not require) additional arguments, and this ability is not supported when passing in $string to the new method. As a result, it's generally a better practice to call the parse method separately. Once a Date::Manip::Date object (or any object in any other Date::Manip class) is created, it should always be used to create additional objects in order to preserve cached data for optimal performance and memory usage. The one caveat is if you are working with multiple configurations as described in the Date::Manip::Objects document. In that case, you may need to create completely new objects to allow multiple Date::Manip::Base objects to be used. new_config $obj2 = $obj1->new_config($string,@opts); This creates a new instance with a new Date::Manip::Base object (and possibly a new Date::Manip::TZ object). For example, $date2 = $date1->new_config(); creates a new Date::Manip::Date object with a new Date::Manip::TZ (and Date::Manip::Base) object. Initially, it is the same configuration as the original object. If the object is a Date::Manip::Base object, the following are equivalent: $base2 = $base1->new_config(); $base2 = $base1->new(); Both $string and @opts are optional. They are used in the same way they are used in the new method. new_date new_delta new_recur These are shortcuts for specifying the class. The following sets of calls are all equivalent: $date = $obj->new_date(); $date = new Date::Manip::Date($obj); $delta = $obj->new_delta(); $delta = new Date::Manip::Date($obj); These methods all allow optional ($string,@opts) arguments. OTHER METHODS
base tz $base = $obj->base(); This returns the Date::Manip::Base object associated with the given object. If $obj is a Date::Manip::Base object, nothing is returned (i.e. it doesn't create a new copy of the object). $tz = $obj->tz(); This returns the Date::Manip::TZ object associated with the given object. If $obj is a Date::Manip::TZ or Date::Manip::Base object, nothing is returned. config $obj->config($var1,$val1,$var2,$val2,...); This will set the value of any configuration variables. Please refer to the Date::Manip::Config manual for a list of all configuration variables and their description. err $err = $obj->err(); This will return the full error message if the previous operation failed for any reason. $obj->err(1); will clear the error code. is_date is_delta is_recur $flag = $obj->is_date(); Returns 0 or 1, depending on the object. For example, a Date::Manip::Date object returns 1 with the is_date method, and 0 for the other two. version $vers = $obj->version($flag); This returns the version of Date::Manip. If $flag is passed in, and $obj is not a Date::Manip::Base object, the version and timezone information will be passed back. KNOWN BUGS
None known. BUGS AND QUESTIONS
Please refer to the Date::Manip::Problems documentation for information on submitting bug reports or questions to the author. SEE ALSO
Date::Manip - main module documentation LICENSE
This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHOR
Sullivan Beck (sbeck@cpan.org) perl v5.14.2 2012-06-02 Date::Manip::Obj(3pm)