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