Time::Format with two $time strings

R

ruud

Is it possible to make with Time::Format two strings like this:

$time1{ddmmyyyy}
$time2{ddmmyyyy}

I only see one $ in the doc's...
 
A

A. Sinan Unur

ruud said:
Is it possible to make with Time::Format two strings like this:

$time1{ddmmyyyy}
$time2{ddmmyyyy}

I only see one $ in the doc's...

What? Please try to paraphrase the question so it make sense.

Surely, you are not asking if the following is possible:

C:\Documents and Settings\asu1\My Documents> cat t.pl
use strict;
use warnings;

use Time::Format;

print "$time{'ddmmyyyy'}\n";
print "$time{'ddmmyyyy'}\n";

__END__


C:\Documents and Settings\asu1\My Documents> perl t.pl
23022005
23022005

Sinan
 
R

ruud

A. Sinan Unur said:
Surely, you are not asking if the following is possible:
print "$time{'ddmmyyyy'}\n";
print "$time{'ddmmyyyy'}\n";

No, this is one string.

I have two dates, today and a timestamp from a file.
So i need two different strings in the ddmmyyyy format.

$today{ddmmyyyy};
$timestamp{ddmmyyyy};

Like that.

English is not my native language, so it's sometimes hard to explain what i
exactly want.
Sorry for that.
 
A

A. Sinan Unur

No, this is one string.

I have two dates, today and a timestamp from a file.
So i need two different strings in the ddmmyyyy format.

$today{ddmmyyyy};
$timestamp{ddmmyyyy};

Like that.

$time is a tied hash, so that is not going to work. However, the first
two examples in the documentation of Time::Format show how to do this.

use strict;
use warnings;

use Time::Format;

my $today = time;
my $stamp = $today - 1000000;

print "Stamp: $time{'ddmmyyyy', $stamp}\n";
print "Today: $time{'ddmmyyyy', $today}\n";

__END__
English is not my native language,

Neither is it mine.
so it's sometimes hard to explain what i exactly want.

That was only due to laziness, because it looks like you can express
yourself fine in English.
Sorry for that.

Apology accepted. Didn't mean to get on your case.

Sinan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top