what is the default return type of localtime() in perl?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting what is the default return type of localtime() in perl?
# 1  
Old 04-29-2011
what is the default return type of localtime() in perl?

Hi,

I have given like this to get the time of the sub routine.

Code:
my $start = localtime();
print "\n start time: $start \n";

Output
Code:
start time: Fri Apr 29 01:01:31 2011

I want to know what is the format of the time.

I am not able to follow is is HH:MM:SS or MM:HH:SS os SS:MM:HH.

What does date command return type?
Code:
Fri Apr 29 01:10:20 EDT 2011
01:10:20 what is the format?
EDT  means what?

How to know exactly time taken by each statement in the sub routine in perl?

Regards
Vanitha
# 2  
Old 04-29-2011
EDT is the timezone I guess like IST (Indian Standard Time), GMT etc

Time Format is HH:MM:SS YYYY

regards,
Ahamed
# 3  
Old 04-29-2011
If you run the commands a few times over the course of at most 60 seconds, you can probably decipher the format yourself. Smilie

Their respective man pages have the answers as well.

localtime - perldoc.perl.org
ctime
asctime
date

Regards,
Alister
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

Struct as return type

Hello all, I am trying to define a function with return type as struct, but seem to be failing. Error I am receiving is following .CC error: prototype for 'RpcHOData L1ITMu::MBLTCollection::getUnassociatedHORpcClusters(double)' does not match any in class 'L1ITMu::MBLTCollection' struct... (1 Reply)
Discussion started by: emily
1 Replies

2. Shell Programming and Scripting

How to use a variable in perl localtime()?

Hi all, a=$1 ## b=`echo "86400 * $a"|bc` `perl -e 'use POSIX qw(strftime);$now_string = strftime "%d/%m/%Y", localtime(time-$b); print $now_string,"\n";' > date_file` but im always getting current date; can any one suggest me any the improvement the above works fine if i use some thing... (2 Replies)
Discussion started by: zozoo
2 Replies

3. Shell Programming and Scripting

Perl help LocalTime in New Format

Hi, I'm new to perl scripting and am trying it out. I have a file written in the following format: myfile-MMDDYY where MM is the number of the Month; DD the Day and YY the last two of the year... (Apologies for dumbing this down; I'm trying to be clear). There is a new file put onto my... (2 Replies)
Discussion started by: Astrocloud
2 Replies

4. Shell Programming and Scripting

Pack and unpack localtime in perl script

Hi I have a code like this: sub WriteEbcdicHeader { my $Htimestamp=localtime();#i need to pack and unpack this my $eheaderline = $Htimestamp; #packing has to be done here #unpacking has to be done after packing print $EOUTFILE return $eheaderline; } sub WriteEbcdicTrailer { ... (5 Replies)
Discussion started by: rbathena
5 Replies

5. Shell Programming and Scripting

date with perl localtime

Hi Experts, I know how to handle normal date changes in perl. Most of my requirement are full filled with following: $date1 = strftime "%Y%m%d",localtime; $date2 = strftime "%Y%m%d",localtime(time -24 * 60 * 60); $date3 = strftime "%Y%m%d",localtime(time +24 * 60 * 60); $date4 = strftime... (4 Replies)
Discussion started by: mtomar
4 Replies

6. Shell Programming and Scripting

PERL localtime Warning

Hello All, I am facing a warning "Argument "" isn't numeric in localtime at" what i m using is below my $timestamp = Timestamp(time); go_log("###############$timestamp###############"); can some one please suggest the way to avoid this message :confused: (6 Replies)
Discussion started by: NIMISH AGARWAL
6 Replies

7. Shell Programming and Scripting

Find command return type

Hi all does find command return anything if the file to be searched is not found? Like if I search from a file in a dir does it return false or null if the file is not found? Please suggests. (3 Replies)
Discussion started by: Veenak15
3 Replies

8. Programming

Help - Cast converts default int return type

What does the warning message 724 "Cast converts default int return type to." tell me. I am new to C. (used it some in college). We are migrating our c-code to 10.2.0.3.0. The programs compiled clean. However there were several warning messages that kick out. The most prominent warning is: ... (5 Replies)
Discussion started by: rtgreen
5 Replies

9. Shell Programming and Scripting

Perl + localtime()

ok here is a perl date question not asked befor. i know i am feeling small for not knowing. BUT!!!! $ENV{TZ}="US/Central"; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(); how can i do the addition to year so i can get the current year w/o going $ntime=$year+1900;... (3 Replies)
Discussion started by: Optimus_P
3 Replies
Login or Register to Ask a Question