Solved

Date formats (How to)

Posted on 1998-11-22
5
169 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

815 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

13 Experts available now in Live!

Get 1:1 Help Now