Re: Convert string into incremental date



djray wrote:
My question is two part:
1. I am reading a date from a file in the form mm/dd/yy (i.e.
05/30/06). I need to convert that string into a date.

Let a module do that for you.

2. I need to be able to increment that date:

Let a module do that for you as well.

#!/usr/bin/perl

use Date::Manip;

my $date = "05/30/06";

$date = DateCalc($date, "+ 1 day");
$date = DateCalc($date, "+ 1 day");

print UnixDate($date, "%D"); #display like mm/dd/yy

__END__

--
David Filmer (http://DavidFilmer.com)

.



Relevant Pages

  • Re: Convert string into incremental date
    ... djray wrote: ... I am reading a date from a file in the form mm/dd/yy (i.e. ... I need to convert that string into a date. ...
    (comp.lang.perl.misc)
  • Re: Convert string into incremental date
    ... djray wrote: ... I am reading a date from a file in the form mm/dd/yy (i.e. ... I need to convert that string into a date. ...
    (comp.lang.perl.misc)
  • Re: Convert string into incremental date
    ... Mothra wrote: ... I am reading a date from a file in the form mm/dd/yy (i.e. ... I need to convert that string into a date. ...
    (comp.lang.perl.misc)
  • Convert string into incremental date
    ... I am reading a date from a file in the form mm/dd/yy (i.e. ... I need to convert that string into a date. ... I need to be able to increment that date: ...
    (comp.lang.perl.misc)
  • Re: Learning the fretboard..
    ... Sight reading at a higher level entails recognition of musical ... is your default handling of two whole steps along a string, ... -Start with a major triad, in root position, with the root on the ... There is only one way to play this triad. ...
    (rec.music.classical.guitar)