The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
perl -write values in a file to @array in perl meghana Shell Programming and Scripting 27 06-07-2009 06:05 PM
[PERL] Running unix commands within Perl Scripts userix Shell Programming and Scripting 1 05-28-2008 07:06 PM
converting localtime to unixtime AshishK UNIX for Advanced & Expert Users 2 10-30-2007 10:22 AM
Perl: Run perl script in the current process vino Shell Programming and Scripting 10 12-09-2005 10:45 AM
Replace Perl Module name in all Perl scripts rahulrathod Shell Programming and Scripting 2 12-02-2005 01:00 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-09-2003
Optimus_P Optimus_P is offline Forum Advisor  
flim flam flamma jamma
  
 

Join Date: May 2001
Location: Chicago IL, USA
Posts: 1,006
Perl + localtime()

ok here is a perl date question not asked befor.

i know i am feeling small for not knowing. BUT!!!!

Code:
$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; AND without useing the system function to call the external date program.

for somereason i cant get it to add 1900 to the year unless i create a new variable.

What do i need it for? to fill in this variable w/ the current full 4 digit year (2003).

$ARCHIVE_OUT="/homes/archive/outbound/${year}_${mon}_${mday}";
 

Bookmarks

Tags
perl localtime

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0