How to get the next time stamp in perl?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to get the next time stamp in perl?
# 1  
Old 07-10-2010
How to get the next time stamp in perl?

Hi,

I have to find the next time stamp in perl.

Here is the code.

Code:
@time = loaltime(time);
print "\n Present time: $time[2]:$time[1]:$time[0] \n";

For example if the time is: "12:55:02" after some process the time becomes 1:00:00.

How do i check when it becomes 00:00 i.e from "12:55:02 to 1:00:00" (For example) is completed?

How can i get the time?

Regards
vanitha
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl:Script to append date and time stamp

Help with Perl script : I have a web.xml file with a line <display-name>some_text_here</display-name> Need to append the current date and time stamp to the string and save the XML file Something like <display-name>some_text_here._01_23_2014_03_56_33</display-name> -->Finally want... (5 Replies)
Discussion started by: gaurav99
5 Replies

2. Shell Programming and Scripting

Time stamp Difference

I have a log file which wrote time stamp like this 2013-02-11 00:46:40.389037 2013-02-12 11:46:40.197045 can any one help me to get the time stamp difference of these two line in seconds. (4 Replies)
Discussion started by: netdbaind
4 Replies

3. Solaris

System time and Cron time stamp not matching

On Solaris 10 server the system date won't match with the timestamp on files created by a cron jobs, Please help here is what i get when i check for system date infodba-ie10ux014:/tcpdv1_ie10/tcadmin/bin\n\r-> date Tue Apr 24 15:27:43 GMT 2012at same time i executed a cron job, and checked... (4 Replies)
Discussion started by: karghum
4 Replies

4. Shell Programming and Scripting

Unable to create logfile with local time stamp using perl

Hello All, Morning, I am facing problem with my code while creating a log with name as current time stamp using perl. Here is the code. #!/usr/bin/perl my $time=localtime; my ($day,$month,$date,$tm,$year)=split(/ /,$time); my $stamp=$year."_".$month."_".$date; my... (4 Replies)
Discussion started by: krsnadasa
4 Replies

5. Shell Programming and Scripting

How to get time duration between two human readable time stamp in Unix?

Here is two time I have: Jul 12 16:02:01 Jul 13 01:02:01 and how can I do a simple match to get difference between two time which is 09:00:00 Thanks in advance. (3 Replies)
Discussion started by: ford99
3 Replies

6. Shell Programming and Scripting

regarding time stamp

hi everyone i am facing a strange problem here suppose content of my file is a=1,2,3 b=2,3,4 c=4,5,6 time= now the problem is i want to add value in front of time variable and the value should be i format only "HHMMSS" so it should be like this a=1,2,3 b=2,3,4 c=4,5,6... (3 Replies)
Discussion started by: aishsimplesweet
3 Replies

7. Shell Programming and Scripting

time stamp perl script error out of range 1..31

Hi, while running the perl script i am getting this error message , Day '' out of range 1..31 at rsty.sh line 44 what do iam missing in the script, any suggestion #!/usr/bin/perl use Time::Local; my $wday = $ARGV; my $month = $ARGV; # convert the month shortname into 0-11 number if... (4 Replies)
Discussion started by: saha
4 Replies

8. Shell Programming and Scripting

Perl, time stamp issue. 60th minutes

Hi Guys, Could you tell me how you can get the time stamp for 60th minutes? Currently, we name our file using time stamp upto minutes and then add seconds at the end starting from 01. And when the seconds reaches 60 we simply add 1 to the time stamp and reset the seconds to 00. But the... (3 Replies)
Discussion started by: supaLucas
3 Replies

9. UNIX for Dummies Questions & Answers

Date/Time Stamp

Hi All, Wondering if there is have a date added at the end of a test string. I have a hypothetical text file day one: John Paul George When the file day one is output, I'd like it to read something like this: John 101406 Paul 101406 George 101406 Day two, when the same text file... (0 Replies)
Discussion started by: JimmyFlip
0 Replies

10. Shell Programming and Scripting

greping with time stamp

Hi all, I want to grep a file name with time stamp as 30 minutes how can i??. Ex I will getting outputs in a file every minutes I want to grep it by a time intervals of 30 and show it . Any help will be great ! Thanks, Arun. (1 Reply)
Discussion started by: arunkumar_mca
1 Replies
Login or Register to Ask a Question
PCAP_SET_TSTAMP_PRECISION(3)				     Library Functions Manual				      PCAP_SET_TSTAMP_PRECISION(3)

NAME
pcap_set_tstamp_precision - set the time stamp precision returned in captures SYNOPSIS
#include <pcap/pcap.h> int pcap_set_tstamp_precision(pcap_t *p, int tstamp_precision); DESCRIPTION
pcap_set_tstamp_precision() sets the precision of the time stamp desired for packets captured on the pcap descriptor to the type specified by tstamp_precision. It must be called on a pcap descriptor created by pcap_create() that has not yet been activated by pcap_activate(). Two time stamp precisions are supported, microseconds and nanoseconds. One can use options PCAP_TSTAMP_PRECISION_MICRO and PCAP_TSTAMP_PRE- CISION_NANO to request desired precision. By default, time stamps are in microseconds. RETURN VALUE
pcap_set_tstamp_type() returns 0 on success if the specified time stamp precision is expected to be supported by the operating system, PCAP_ERROR_TSTAMP_PRECISION_NOTSUP if operating system does not support requested time stamp precision, PCAP_ERROR_ACTIVATED if called on a capture handle that has been activated. SEE ALSO
pcap(3), pcap_get_tstamp_precision(3), pcap-tstamp(7) 27 August 2013 PCAP_SET_TSTAMP_PRECISION(3)