Help for this page

Select Code to Download


  1. or download this
    my $xcltime = "19:45:34"; # It should print 7:45 PM
    my $xcltime2 = "23:35:14"; # It should print 11:35 PM
    
    if (($xcltime =~ /(\d{1,2}):(\d{1,2}):(\d{1,2})/) || ($xcltime2 =~ /(\
    +d{1,2}):(\d{1,2}):(\d{1,2})/)) {
    
  2. or download this
        my $h1=$1;my $m2=$2; my $s3=$3;
        if ($h1 =~ /13||14||15||16||17||18||19||20||21||22||23||24/) {
    
  3. or download this
             $h1=~s/13/1/;
             $h1=~s/14/2/;
    ...
             $h1=~s/22/10/;
             $h1=~s/23/11/;
             $h1=~s/24/12/;
    
  4. or download this
    my $pm = 0;  # assume AM
    if ($h1 > 12) {
      $pm = 1;
      $h1 -= 12;
    }