I m not looking for a static but a dynamic solution.
The date should change one week prior for any given file on any given day.
Hello mohtashims,
If you have GNU datein your system then following may help you in same.
Let's say we have following Input_file(as an example).
Then following is the command for changing the timings.
Now after executing above command, when you check the Input_file details they will be as follows.
Thanks,
R. Singh
Last edited by RavinderSingh13; 07-28-2016 at 07:15 AM..
I have to capture the creation date and time stamp for a file. The ls command doesn't list all the required information. I need year, month, day, hour, minute and second.
Any ideas... (1 Reply)
I am trying to insert a line with a date stamp in a file that is used to monitor activity in one of our directories. By doing this, I want to grep that file each day and go to the last entry for each time a error occurred and pull all errors generated if any exist. If error exists I want that error... (3 Replies)
Hi,
Plz suggest me how can i change the date of a file.
Suppose my file has been created in some date and i want to give it present date.
How can i do this???? (2 Replies)
can we change the timestamp of a file to old date.
-rwxrwxrwx 1 root other 330 Jul 1 16:03 abc.txt
it shows creation time is 16.03 can i change it to previous time
:) (2 Replies)
Hi,
As i know , we can change the time stamp of a file by touch command, i did change in a file and it is looking as given
# ls -l abcd
-rw-r--r-- 1 batsoqa sicusers 0 Feb 17 2010 abcd
actually i want to see the output like this
-rw-r--r-- 1 batsoqa sicusers ... (3 Replies)
Hi
When i do ls -ltr <file1> then it shows me the date and time of the file
if - for whatever reason file has future date/time stamp then ls -ltr is not showing the time, it just shows only date part ... even if time is ahead by 2 hr than current time.
suppose a file was copied from INDIA... (3 Replies)
Hi
I use "touch -t xxxxxxxx" command to set date/time stamp of a file. My requirement is to read the date/time stamp of a file and apply it to another file.
Is there anyway to do it simple instead of manually taking date/stamp of first file?
TIA
Prvn (2 Replies)
Hi!
Please see our current script:
#!/usr/bin/ksh
if (egrep "This string is found in the log" /a01/bpm.log)
then
mailx -s "Error from log" me@email.com, him@email.com </a01/bpm.log
fi
To the above existing script, we need to add the following change:
1) After finding the string,... (7 Replies)
hi,
i have a Archive directory in which files are archived or stored with date and time stamp to prevent over writing.
example:
there are 5 files
s1.txt
s2.txt
s3.txt
s4.txt
s5.txt
while moving these files to archive directory, date and time stamp is added.
of format `date... (9 Replies)
Hi ,
I want to add a new column 'current_time stamp' in my existing csv file with current time stamp for all the records.I tried something this but this is printing 0 with date & time and printed date one line above header.Please help
awk -F "," 'BEGIN{ OFS="," } {$6=system("date... (5 Replies)
Discussion started by: netdbaind
5 Replies
LEARN ABOUT PHP
px_timestamp2string
PX_TIMESTAMP2STRING(3)PX_TIMESTAMP2STRING(3)px_timestamp2string - Converts the timestamp into a string.SYNOPSIS
string px_timestamp2string (resource $pxdoc, float $value, string $format)
DESCRIPTION
Turns a timestamp as it stored in the paradox file into human readable format. Paradox timestamps are the number of miliseconds since
0001-01-02. This function is just for convenience. It can be easily replaced by some math and the calendar functions as demonstrated in the
following example.
PARAMETERS
o $pxdoc
- Resource identifier of the paradox database.
o $value
- Value as stored in paradox database field of type PX_FIELD_TIME, or PX_FIELD_TIMESTAMP.
o $format
- String format similar to the format used by date(3). The placeholders support by this function is a subset of those supported by
date(3) (Y, y, m, n, d, j, H, h, G, g, i, s, A, a, L).
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Turn a paradox timestamp into a human readable form
<?php
$px = px_new();
/* make up a date as it could be stored in */
/* a date field of a paradox db. */
/* 700000 days since 1.1.0000. */
$days = 700000;
/* Use the calendar functions to print a */
/* human readable format of the date */
echo jdtogregorian($days+1721425)."
";
/* Turn it into a timestamp as it stored in a paradox database */
/* Timestamps are stored in miliseconds since 0001-01-02 */
$stamp = $days * 86400.0 * 1000.0;
/* Add one hour */
$stamp += 3600000.0;
/* The following will output '7/15/1917 01:00:00'. */
echo px_timestamp2string($px, $stamp, "n/d/Y H:i:s")."
";
px_delete($px);
?>
The above example will output:
7/15/1917
7/15/1917 01:00:00
The Julian day count as passed to jdtogregorian(3) has a different base of 1.1.4714 b.c. and must therefore be calculated by adding
1721425 to the day count used in the paradox file. Turning the day count into a timestamp is easily done by multiplying with 86400000.0 to
obtain miliseconds.
SEE ALSO px_date2string(3), jdtogregorian(3).
PHP Documentation Group PX_TIMESTAMP2STRING(3)