Commit | Line | Data |
16433e2b |
1 | Time::Piece |
2 | =========== |
3 | |
4 | This module supercedes Time::Object (and has a better name). |
5 | |
6 | At this time the module is almost identical to Time::Object, with |
7 | the exception of strptime support. People using Time::Object should |
8 | migrate over to Time::Piece as they are able to do so. No further |
9 | development will occur to Time::Object. |
10 | |
11 | DESCRIPTION |
12 | |
13 | Have you ever thought you time was thoroughly wasted by doing: |
14 | |
15 | $ perldoc -f localtime |
16 | |
17 | just to recall the position of wday or some other item in the returned |
18 | list of values from localtime (or gmtime) ? |
19 | |
20 | Well Time::Piece is the answer to your prayers. |
21 | |
22 | Time::Piece does the right thing with the return value from localtime: |
23 | |
24 | - in list context it returns a list of values |
25 | |
26 | - in scalar context it returns a Time::Piece object |
27 | |
28 | - when stringified (or printed), Time::Piece objects look like |
29 | the output from scalar(localtime) |
30 | |
31 | Beyond that, Time::Piece objects allow you to get any part of the |
32 | date/time via method calls, plus they allow you to get at the string |
33 | form of the week day and month. It has methods for julian days, and |
34 | some simple date arithmetic options. |
35 | |
36 | Time::Piece also gives you easy access to your C library's strftime |
37 | and strptime functions, so you can parse and output locale sensitive |
38 | dates to your heart's content :-) |
39 | |