On Aug 13, 2:56 pm, [EMAIL PROTECTED] (Arun) wrote:
> Hi,
>        As i am new to perl i just wanted to define a string with the
> current date and time.
> For example:
> current_date-current_time::Arun::current_date,current_time,Prakash
>
> so how do i define this string......

Hello,

I think this can be done by using "POSIX qw(strfttime)" or
"Date::Manip".
e.g.
#1.
use POSIX qw(strftime);
print strftime('%Y%m%d-%H:%M', localtime);  # for more info about
strftime please use 'man strftime'.
#2.
use Date::Manip;
$str = UnixDate('today', '%Y%b%e-%T') ;
print $str; #see perldoc Date::Manip for more detail

Does them meet you requirement?
Best Regards


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to