Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Time Module

Expand Messages
  • Tom Barron
    How bout this? sub get_time { # -------------------------------------------------------- # Returns the time in the format hh-mm-ss [a|p]m . # ($S,$M,$H) =
    Message 1 of 3 , Nov 1, 2000
    • 0 Attachment
      How 'bout this?

      sub get_time {
      # --------------------------------------------------------
      # Returns the time in the format "hh-mm-ss [a|p]m".
      #
      ($S,$M,$H) = localtime;
      $ampm = ($H <= 12) ? "am" : "pm";
      $H = (($H-1) % 12) + 1;
      $rval = sprintf("%02d:%02d:%02d %s", $H, $M, $S, ($H <= 12) ? "am" :
      "pm");
      }

      Mike Graves wrote:
      >
      > I need to refine the sub routine below to show am and pm if possible.
      > Any ideas?
      > ...
    • Smith, Eric - WPAFB/YSXOI
      Slight change to Tom Barron s sub... (put $ampm and added CST in the sprintf line)... sub get_time { #
      Message 2 of 3 , Nov 1, 2000
      • 0 Attachment
        Slight change to Tom Barron's sub...

        (put $ampm and added "CST" in the sprintf line)...

        sub get_time {
        # --------------------------------------------------------
        # Returns the time in the format "hh-mm-ss [a|p]m".
        #
        ($S,$M,$H) = localtime;
        $ampm = ($H <= 12) ? "am" : "pm";
        $H = (($H-1) % 12) + 1;
        $rval = sprintf("%02d:%02d:%02d %s", $H, $M, $S, $ampm);
        }

        - Eric D. Smith
      Your message has been successfully submitted and would be delivered to recipients shortly.