CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
string manipulation

 



1cor29
New User

Jul 20, 2011, 5:32 AM

Post #1 of 2 (14501 views)
string manipulation Can't Post

Greetings - new here. I'm not new to Perl, but only experienced enough to be considered a beginner. Anyhow, I need to manipulate a date string but I haven't been able to figure it out after multiple attempts. I want to be able to print the date starting with a "V", followed by the year, the month in a two-digit format, and the day in a two-digit format; like VYYYYMMDD. Example would be (for today's date) V20110720.


FishMonger
Veteran / Moderator

Jul 20, 2011, 6:15 AM

Post #2 of 2 (14498 views)
Re: [1cor29] string manipulation [In reply to] Can't Post


Code
use POSIX 'strftime'; 

my $datestamp = strftime('V%Y%m%d', localtime);
print $datestamp;


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives