Exforsys
+ Reply to Thread
Results 1 to 4 of 4

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?...

  1. #1
    seenu01 is offline Junior Member Array
    Join Date
    Feb 2006
    Answers
    11

    Current date from the system

    Hi Friends,
    Is there any way one can get the current date from the system in Perl?


  2. #2
    kiruthika_sri is offline Junior Member Array
    Join Date
    Feb 2010
    Answers
    4
    Try with the following ways,
    Code:
    use POSIX;
    
    
    print system("date");
    print strftime "%m/%d/%y",localtime;



  3. #3
    moonlight is offline Banned Array
    Join Date
    Jul 2008
    Answers
    27
    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.

  4. #4
    Abdul_ali is offline Junior Member Array
    Join Date
    Dec 2011
    Answers
    4
    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



Latest Article

Network Security Risk Assessment and Measurement

Read More...