Solved

Date formats (How to)

Posted on 1998-11-22
5
148 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
Comment Utility
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
Comment Utility
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
Comment Utility
is perl on your path?
0
 
LVL 5

Expert Comment

by:b2pi
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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 …
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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

8 Experts available now in Live!

Get 1:1 Help Now