Install Perl 5.8.8
[msysgit.git] / mingw / html / lib / Time / gmtime.html
blob1e21010f8e1d6e7db598908a58ebdfdb5eb3be7e
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>Time::gmtime - by-name interface to Perl's built-in gmtime function</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:" />
8 </head>
10 <body style="background-color: white">
11 <table border="0" width="100%" cellspacing="0" cellpadding="3">
12 <tr><td class="block" style="background-color: #cccccc" valign="middle">
13 <big><strong><span class="block">&nbsp;Time::gmtime - by-name interface to Perl's built-in gmtime function</span></strong></big>
14 </td></tr>
15 </table>
17 <p><a name="__index__"></a></p>
18 <!-- INDEX BEGIN -->
20 <ul>
22 <li><a href="#name">NAME</a></li>
23 <li><a href="#synopsis">SYNOPSIS</a></li>
24 <li><a href="#description">DESCRIPTION</a></li>
25 <li><a href="#note">NOTE</a></li>
26 <li><a href="#author">AUTHOR</a></li>
27 </ul>
28 <!-- INDEX END -->
30 <hr />
31 <p>
32 </p>
33 <h1><a name="name">NAME</a></h1>
34 <p>Time::gmtime - by-name interface to Perl's built-in <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_gmtime"><code>gmtime()</code></a> function</p>
35 <p>
36 </p>
37 <hr />
38 <h1><a name="synopsis">SYNOPSIS</a></h1>
39 <pre>
40 use Time::gmtime;
41 $gm = gmtime();
42 printf &quot;The day in Greenwich is %s\n&quot;,
43 (qw(Sun Mon Tue Wed Thu Fri Sat Sun))[ gm-&gt;wday() ];</pre>
44 <pre>
45 use Time::gmtime w(:FIELDS;
46 printf &quot;The day in Greenwich is %s\n&quot;,
47 (qw(Sun Mon Tue Wed Thu Fri Sat Sun))[ gm_wday() ];</pre>
48 <pre>
49 $now = gmctime();</pre>
50 <pre>
51 use Time::gmtime;
52 use File::stat;
53 $date_string = gmctime(stat($file)-&gt;mtime);</pre>
54 <p>
55 </p>
56 <hr />
57 <h1><a name="description">DESCRIPTION</a></h1>
58 <p>This module's default exports override the core <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_gmtime"><code>gmtime()</code></a> function,
59 replacing it with a version that returns ``Time::tm'' objects.
60 This object has methods that return the similarly named structure field
61 name from the C's tm structure from <em>time.h</em>; namely sec, min, hour,
62 mday, mon, year, wday, yday, and isdst.</p>
63 <p>You may also import all the structure fields directly into your namespace
64 as regular variables using the :FIELDS import tag. (Note that this
65 still overrides your core functions.) Access these fields as variables
66 named with a preceding <code>tm_</code> in front their method names. Thus,
67 <code>$tm_obj-&gt;mday()</code> corresponds to $tm_mday if you import the fields.</p>
68 <p>The <code>gmctime()</code> function provides a way of getting at the
69 scalar sense of the original CORE::gmtime() function.</p>
70 <p>To access this functionality without the core overrides,
71 pass the <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_use"><code>use</code></a> an empty import list, and then access
72 function functions with their full qualified names.
73 On the other hand, the built-ins are still available
74 via the <code>CORE::</code> pseudo-package.</p>
75 <p>
76 </p>
77 <hr />
78 <h1><a name="note">NOTE</a></h1>
79 <p>While this class is currently implemented using the Class::Struct
80 module to build a struct-like class, you shouldn't rely upon this.</p>
81 <p>
82 </p>
83 <hr />
84 <h1><a name="author">AUTHOR</a></h1>
85 <p>Tom Christiansen</p>
86 <table border="0" width="100%" cellspacing="0" cellpadding="3">
87 <tr><td class="block" style="background-color: #cccccc" valign="middle">
88 <big><strong><span class="block">&nbsp;Time::gmtime - by-name interface to Perl's built-in gmtime function</span></strong></big>
89 </td></tr>
90 </table>
92 </body>
94 </html>