#!/usr/bin/perl -w #============================================================================= # # File: zeit.pl # # Usage: ./zeit.pl # # Synopsis: Konvertiert Zeit in 1:30 in 1,5 # Author: Volker Kroll (VK), kroll@allein-zu-haus.de # Created: 08.06.2005 13:20:52 CEST # Last Change: Mi 2005-06-08 13:30 # # This script is free software; you can redistribute it and/or modify it # under the same terms as Perl itself. # # #============================================================================= use strict; my $time = $ARGV[0]; unless ($time) { die "Please submit a time"; } unless ($time =~ /^\d\d:\d\d$/) { die "Please submit a time in format HH:MM"; } my ($h, $m) = $time =~ /(\d\d):(\d\d)/; $m = $m/6*10; printf( "Your decimal time is: %02d.%02d " , $h, $m);