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">
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:" />
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"> Time::gmtime - by-name interface to Perl's built-in gmtime function
</span></strong></big>
17 <p><a name=
"__index__"></a></p>
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>
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>
38 <h1><a name=
"synopsis">SYNOPSIS
</a></h1>
42 printf
"The day in Greenwich is %s\n
",
43 (qw(Sun Mon Tue Wed Thu Fri Sat Sun))[ gm-
>wday() ];
</pre>
45 use Time::gmtime w(:FIELDS;
46 printf
"The day in Greenwich is %s\n
",
47 (qw(Sun Mon Tue Wed Thu Fri Sat Sun))[ gm_wday() ];
</pre>
49 $now = gmctime();
</pre>
53 $date_string = gmctime(stat($file)-
>mtime);
</pre>
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-
>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>
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>
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"> Time::gmtime - by-name interface to Perl's built-in gmtime function
</span></strong></big>