Check if a date field has date or timestamp or date×tamp
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×tamp. I have to figure out the the data is a date or time stamp or date×tamp.
If it is date then append "<space>00:00:00" to it.
If it is a time stamp, store the data in a different file(invalid_dttmstmp.txt) and remove from this file.
If it is a date timestamp then do nothing.
Input file:
Expected output
I coded for date part and that works. I need help with time stamp validation
Thanks
---------- Post updated 02-26-12 at 12:01 AM ---------- Previous update was 02-25-12 at 11:44 PM ----------
Is it correct to use
Is this logic correct. Also can this handle around 4000 different values (if I go for loop) with in a few minutes (1-2min)??
Could someone tell me how to get the date/time (to the second) a file was last modified? I need to know if a file was modified in the last 30 seconds from the system date. I'm on AIX/unix 4.3 (3 Replies)
Hi All,
i have a time stamp. from that i am trying to awk to get the year, month and date.
TIME=20060614092446
DESIRED OUTPUT: 20060614
i am doing the following;
TIME=20060614092446
$ TimeStarted=`expr match '$TIME' '.*\(......\)'`
echo $TimeStarted
i am not getting... (2 Replies)
Hello all
This is a sample vmstat output ...
$ vmstat 2 2
kthr memory page disk faults cpu
r b w swap free re mf pi po fr de sr hx hx hx hx in sy cs us sy id
1 0 0 23105784 7810488 323 767 1742 5 5 0 0 0 0 0 0 683 780 457 43 ... (9 Replies)
Hi,
This is my script:
#! /usr/bin/ksh
cd /app/chdata/workflow/suppl/esoutput/spd/testing
for file in /app/chdata/workflow/suppl/esoutput/spd/testing
do
sort *.txt | awk '{ file=substr($0,1,2)".txt"; print >> file }' ... (3 Replies)
Hi,
I have list of files as below, with prefix named as date & time. Anyone how to transform each file as below to yyyy-mm-dd hh:mm:ss
Regards, (8 Replies)
Hi,
I have a file containing timestamp( Example given below). How can i get date(mmd-dd-yyyy) from it?
($> cat file1.txt
2008-11-24 05:17:00.7043)
Thanks,
Sri (2 Replies)
How would I convert a unix timestamp such as "1232144092" to a readable date such as "1/16/2009 10:14:28 PM" ?
I thought I could use date, but I don't think so now.. Any help would be great!! (4 Replies)
Hi,
I have a file file1 having data as below
20110501,070742, ,012345678909,09999999999,68.5,
20110501,070236, ,089375855455,09376383333,374.3,
20110501,070525, ,090345895555,08444233444,206.2,
20110501,230051, ,000934744433,07624262223,480.1,
First field is date(YYYYMMDD) and second... (5 Replies)
Hi,
I have many files in the source directory but I need to process with the latest timestamp file.
I am using linux operating system. i want extract the file created timestamp( Ext_File_create_date=)
With this format YYYYMMDD-
i have searched the relevent command in the unix forms but did... (5 Replies)
Hello,
I have files that with a naming convention as shown below. Some of the files have dates in the file name and some of them don't have dates in the file name.
imap-hp-import-20150917.txt
imap-dell-gec-import-20150901.txt
imap-cvs-import-20150915.txt
imap-gec-import.txt... (8 Replies)
Discussion started by: Saanvi1
8 Replies
LEARN ABOUT PHP
http_cache_last_modified
HTTP_CACHE_LAST_MODIFIED(3) 1 HTTP_CACHE_LAST_MODIFIED(3)http_cache_last_modified - Caching by last modificationSYNOPSIS
bool http_cache_last_modified ([int $timestamp_or_expires])
DESCRIPTION
Attempts to cache the sent entity by its last modification date.
If the supplied argument is greater than 0, it is handled as timestamp and will be sent as date of last modification. If it is 0 or omit-
ted, the current time will be sent as Last-Modified date. If it's negative, it is handled as expiration time in seconds, which means that
if the requested last modification date is not between the calculated timespan, the Last-Modified header is updated and the actual body
will be sent.
A log entry will be written to the cache log if the INI settinghttp.log.cache is set and the cache attempt was successful.
Note
This function may be used in conjunction with http_send_data(3), http_send_file(3) and http_send_stream(3).
PARAMETERS
o $timestamp_or_expires
- Unix timestamp
RETURN VALUES
Returns FALSE or exits on success with 304 Not Modified if the entity is cached. See the INI settinghttp.force_exit for what "exits"
means.
EXAMPLES
Example #1
A http_cache_last_modified(3) example
Caching for 5 seconds.
<?php
http_cache_last_modified(-5);
printf("%s
", http_date());
?>
SEE ALSO http_cache_etag(3), the HttpResponse class if you are using PHP 5.1.0 and above.
PHP Documentation Group HTTP_CACHE_LAST_MODIFIED(3)