1Time::CTime(3) User Contributed Perl Documentation Time::CTime(3)
2
3
4
6 Time::CTime -- format times ala POSIX asctime
7
9 use Time::CTime
10 print ctime(time);
11 print asctime(localtime(time));
12 print strftime(template, localtime(time));
13
14 strftime conversions
15 %% PERCENT
16 %a day of the week abbr
17 %A day of the week
18 %b month abbr
19 %B month
20 %c ctime format: Sat Nov 19 21:05:57 1994
21 %d DD
22 %D MM/DD/YY
23 %e numeric day of the month
24 %f floating point seconds (milliseconds): .314
25 %F floating point seconds (microseconds): .314159
26 %h month abbr
27 %H hour, 24 hour clock, leading 0's)
28 %I hour, 12 hour clock, leading 0's)
29 %j day of the year
30 %k hour
31 %l hour, 12 hour clock
32 %m month number, starting with 1, leading 0's
33 %M minute, leading 0's
34 %n NEWLINE
35 %o ornate day of month -- "1st", "2nd", "25th", etc.
36 %p AM or PM
37 %r time format: 09:05:57 PM
38 %R time format: 21:05
39 %S seconds, leading 0's
40 %t TAB
41 %T time format: 21:05:57
42 %U week number, Sunday as first day of week
43 %v DD-Mon-Year
44 %w day of the week, numerically, Sunday == 0
45 %W week number, Monday as first day of week
46 %x date format: 11/19/94
47 %X time format: 21:05:57
48 %y year (2 digits)
49 %Y year (4 digits)
50 %Z timezone in ascii. eg: PST
51
53 This module provides routines to format dates. They correspond to the
54 libc routines. &strftime() supports a pretty good set of conversions
55 -- more than most C libraries.
56
57 strftime supports a pretty good set of conversions.
58
59 The POSIX module has very similar functionality. You should consider
60 using it instead if you do not have allergic reactions to system
61 libraries.
62
64 Written by David Muir Sharnoff <muir@idiom.org>.
65
66 The starting point for this package was a posting by Paul Foley
67 <paul@ascent.com>
68
70 Copyright (C) 1996-2010 David Muir Sharnoff. Copyright (C) 2011
71 Google, Inc. License hereby granted for anyone to use, modify or
72 redistribute this module at their own risk. Please feed useful changes
73 back to cpan@dave.sharnoff.org.
74
75
76
77perl v5.36.0 2023-01-20 Time::CTime(3)