11-11-2011
find files for next day of the date entered
i have few files generated everyday with a date stamp. Sometimes it happens that if the files are generated late i.e after 00:00 hrs the date stamp will be of the next day.
example:
110123_file1
110123_file2
110123_file3
110124_file4
in the above example file4 is also for the previous day i.e 23rd(as per example) but its generated after 00:00hrs which results in date stamp for the current day.
i want to copy the files for a specific date to another location but in this case only 3 files will be copied and file4 will be copied for the next day run while file4 is for the previous day.
lets say these files are generated after 20:45hrs everyday. but if there is any delay also the files will be generated within 02:00hrs the next day. so i want to have a check wherein i input the date(23rd for the example above) and it should take all the files generated after 20:45hrs for the date entered even the file4 in this case.
all the files generated will have standard filename along with the date stamp.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
How to find the Day of the Week of the given Date using perl?
If I have a date in YYY--MM-DD format, how to find the DOW? Based on that, I need to find the following sunday.
Pls help. (5 Replies)
Discussion started by: deepakwins
5 Replies
2. Shell Programming and Scripting
Hi,
Is there any function in Unix by which v can find the exact day of any given date. Like i need to get Wednesday if i give 05 07 2008 (format MM DD YYYY)
Thanks,
RRVARMA (5 Replies)
Discussion started by: RRVARMA
5 Replies
3. Shell Programming and Scripting
Hi All,
I am using the below command to check the files modified within last 24hours
find /home/karthik -mtime -1 -type f -exec ls -l {} \;
What parameter do i need to add in the above command to check the files modified in last 2 or 3 days
Kindly let me know if any other alternative... (2 Replies)
Discussion started by: karthikn7974
2 Replies
4. Shell Programming and Scripting
I need the date validation. I searched in the google but i didn't find my requirements.
requirements:
1) user has to enter the date in YYYY/MM/DD format
2) MM validations
3) DD validations.
and if the month is april it should allow 30 days only and for May month it should allow 31 days like... (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies
5. HP-UX
Dear Frends,
Could you please help me with the command or option by which I can find
day where the input is date(can be of future or past).
I do have for linux, However it is not working @ hp unix.
Please help.
Regards
Rahul (4 Replies)
Discussion started by: Rahul chitriv
4 Replies
6. Shell Programming and Scripting
Hi,
I need to find all files of particular day lets say for 2nd august in below.
-rw-r--r-- 1 skl eusdc 8168 Aug 5 19:31 aabc123.txt
-rw-r--r-- 1 skl eusdc 4251 Aug 5 19:31 aabc124.txt
-rw-r--r-- 1 skl eusdc 4252 Aug 6 19:31 aabc125.txt
-rw-r--r-- ... (15 Replies)
Discussion started by: sachinkl
15 Replies
7. Shell Programming and Scripting
I wan to view files in a directory of a specific date. For example a log directory has log files . I want to view the list of the files which were generated on 01-May-2011.
Is there any option/proces to perform it?? (1 Reply)
Discussion started by: mady135
1 Replies
8. Shell Programming and Scripting
Hi Experts,
i am using the below code get the date of previous day.
#!/usr/bin/ksh
datestamp=`date '+%Y%m%d'`
yest=$((datestamp -1))
echo $yest
When i execute the code i am getting output as:
20130715
What i am trying here is, based on the date passed i am fetching previus day's... (0 Replies)
Discussion started by: learner24
0 Replies
9. Shell Programming and Scripting
Need a ksh script to get the files that were created or modified in a directory on a particular date entered by the user.
For example if a directory contains files as below :
> ll
total 41
-rw-rw-r-- 1 psn psn 199 Aug 23 07:06 psn_roll.sh
-rw-rw-r-- 1 psn psn ... (10 Replies)
Discussion started by: ramprabhum
10 Replies
10. AIX
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)
Discussion started by: rpm120
1 Replies
LEARN ABOUT PHP
datetime.setisodate
DATETIME.SETISODATE(3) 1 DATETIME.SETISODATE(3)
DateTime::setISODate - Sets the ISO date
Object oriented style
SYNOPSIS
public DateTime DateTime::setISODate (int $year, int $week, [int $day = 1])
DESCRIPTION
Procedural style
DateTime date_isodate_set (DateTime $object, int $year, int $week, [int $day = 1])
Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates.
PARAMETERS
o $object
-Procedural style only: A DateTime object returned by date_create(3). The function modifies this object.
o $year
- Year of the date.
o $week
- Week of the date.
o $day
- Offset from the first day of the week.
RETURN VALUES
Returns the DateTime object for method chaining or FALSE on failure.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.0 | |
| | |
| | Changed the return value on success from NULL to |
| | DateTime. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
DateTime.setISODate(3) example
Object oriented style
<?php
$date = new DateTime();
$date->setISODate(2008, 2);
echo $date->format('Y-m-d') . "
";
$date->setISODate(2008, 2, 7);
echo $date->format('Y-m-d') . "
";
?>
Procedural style
<?php
$date = date_create();
date_isodate_set($date, 2008, 2);
echo date_format($date, 'Y-m-d') . "
";
date_isodate_set($date, 2008, 2, 7);
echo date_format($date, 'Y-m-d') . "
";
?>
The above examples will output:
2008-01-07
2008-01-13
Example #2
Values exceeding ranges are added to their parent values
<?php
$date = new DateTime();
$date->setISODate(2008, 2, 7);
echo $date->format('Y-m-d') . "
";
$date->setISODate(2008, 2, 8);
echo $date->format('Y-m-d') . "
";
$date->setISODate(2008, 53, 7);
echo $date->format('Y-m-d') . "
";
?>
The above example will output:
2008-01-13
2008-01-14
2009-01-04
Example #3
Finding the month a week is in
<?php
$date = new DateTime();
$date->setISODate(2008, 14);
echo $date->format('n');
?>
The above examples will output:
3
SEE ALSO
DateTime.setDate(3), DateTime.setTime(3).
PHP Documentation Group DATETIME.SETISODATE(3)