Date in Perl

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
Nik
Forum Contributor
Posts: 138
Joined: Wed Jan 29, 2003 6:02 pm
Location: Thessaloniki, Greece

Date in Perl

Post by Nik »

This is tha date command for php
$xronos=date("l dS of F h:i:s A");

Whats the equivalent for perl?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Hi could you please post non-PHP programming questions (e.g. like those about Perl) in the Miscellaneous forum because, as it says in the description,:
Miscellaneous
XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).
I've moved this post here because it really is the most appropriate place for it.

Mac
Nik
Forum Contributor
Posts: 138
Joined: Wed Jan 29, 2003 6:02 pm
Location: Thessaloniki, Greece

Post by Nik »

You are absolutely right, i didnt happen to see the misc forum so far!

Thank you for removing the post....

Do u know why i dont get mail notifications even though i have notify ON?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

you can fetch the current time with

Code: Select all

my $now = localtime time;
if you want the single parts try

Code: Select all

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime time;
then you can rearrange them as you like.
http://www.cpan.org/modules/index.html lists many modules for date/time-handling.
see also: http://www.perldoc.com/perl5.8.0/pod/fu ... ltime.html
Post Reply