Solved

Date formats (How to)

Posted on 1998-11-22
5
160 Views
Last Modified: 2010-03-04
Hi.....
Can anyone give me some samples on Date manipulation....
I need to get just the date and then the time.
21/11/98
18:35
regards
0
Comment
Question by:rickyr
  • 3
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
b2pi earned 20 total points
ID: 1206442
There are thousands of ways....

Try looking first at

perldoc -f localtime

That will show you that you can do

( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime;
$mon++;
$date = "$mday/$mon/$year";
$time = "$hour:$min";

If you need more flexibility than that, take a look at Date::Calc and Date::Manip


0
 
LVL 3

Author Comment

by:rickyr
ID: 1206443
Thanx v.much.
incidentally, as a freebee question. perldoc doesn't work.
How do I install it????????
Thanx again.
0
 
LVL 5

Expert Comment

by:b2pi
ID: 1206444
is perl on your path?
0
 
LVL 5

Expert Comment

by:b2pi
ID: 1206445
is perl on your path? If so, perldoc should be also.  What happens when you run it? (Does activeState include perldoc???)
0
 
LVL 3

Author Comment

by:rickyr
ID: 1206446
Hi......
/usr/local/bin wasn't in my path, There was a symbolic link for perl in /usr/bin, thats  how perl was indirectly in my path, but the full disribution wasn't.
thanks again.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Perl strange behaviour 5 68
Parse csv file and generate graphs in HTML in bash 8 157
create a gui in perl 3 70
Log File Creation with Header and Footer 17 57
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now