
- Forum
- Programming Talk
- Perl
- Current date from the system
Current date from the system
This is a discussion on Current date from the system within the Perl forums, part of the Programming Talk category; Hi Friends, Is there any way one can get the current date from the system in Perl?...
-
Current date from the system
Hi Friends,
Is there any way one can get the current date from the system in Perl?
-
02-24-2010, 07:23 AM #2
- Join Date
- Feb 2010
- Answers
- 4
Try with the following ways,
Code:use POSIX; print system("date"); print strftime "%m/%d/%y",localtime;
-
I don't feel its possible you may check the documentation to see if there might be something that could serve to hack something together:
perldoc.perl.org/functions/time.html
Last edited by admin; 02-26-2010 at 06:46 AM.
-
Hi,
Please check below.
use Time::localtime;
$tm = localtime;
printf("The current date is %04d-%02d-%02d\n", $tm->year+1900,($tm->mon)+1, $tm->mday);
-
Sponsored Ads

Reply With Quote





