Help for this page

Select Code to Download


  1. or download this
    my $current_hour = strftime( "%H", localtime() ); # say it's 9:59, so 
    +"9" is returned.
    # ... your process is switched off the processor...
    my $current_minute = strftime( "%M", localtime() ); # now it's 10:00, 
    +so "00" is returned.
    
  2. or download this
    #my $store_close = "7:05 PM";
    
    my $store_close = "19:05";
    my ($close_hour, $close_minute) = split( /:/, $store_close );
    my ($current_minute, $current_hour) = (localtime)[1,2];