rsiedl has asked for the wisdom of the Perl Monks concerning the following question:
Does anyone know a better way to do this?#!/usr/bin/perl use strict; use warnings; use POSIX; my $time = "08:30:12"; my (@time) = split(/:/, $time); my (@lt) = localtime(); my $secs = mktime($time[2], $time[1], $time[0], $lt[3], $lt[4], $lt[5] +, $lt[6]. $lt[7], $lt[8]); # Lets check if the $secs return the correct time... my $today = strftime "%D, %T", localtime($secs); print $today , "\n"; exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Convert time to todays time
by graff (Chancellor) on Jun 08, 2004 at 09:09 UTC | |
|
Re: Convert time to todays time
by Jaap (Curate) on Jun 08, 2004 at 11:30 UTC | |
|
Re: Convert time to todays time
by ysth (Canon) on Jun 08, 2004 at 09:55 UTC | |
by jeffa (Bishop) on Jun 08, 2004 at 21:12 UTC | |
|
Re: Convert time to todays time
by gnork (Scribe) on Jun 08, 2004 at 10:44 UTC | |
|
Re: Convert time to todays time
by Anonymous Monk on Jun 08, 2004 at 22:19 UTC |