Solved

Date formats (How to)

Posted on 1998-11-22
5
186 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
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…

738 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