icon Top 9 categories map      RocketAware > Perl >

gmtime EXPR

Tips: Browse or Search all pages for efficient awareness of Perl functions, operators, and FAQs.



Home

Search Perl pages


Subjects

By activity
Professions, Sciences, Humanities, Business, ...

User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...

Text Strings
Conversions, tests, processing, manipulation,...

Math
Integer, Floating point, Matrix, Statistics, Boolean, ...

Processing
Algorithms, Memory, Process control, Debugging, ...

Stored Data
Data storage, Integrity, Encryption, Compression, ...

Communications
Networks, protocols, Interprocess, Remote, Client Server, ...

Hard World
Timing, Calendar and Clock, Audio, Video, Printer, Controls...

File System
Management, Filtering, File & Directory access, Viewers, ...

    
gmtime EXPR
Converts a time as returned by the time function to a 9-element array with the time localized for the standard Greenwich time zone. Typically used as follows:

    #  0    1    2     3     4    5     6     7     8
    ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
                                            gmtime(time);

All array elements are numeric, and come straight out of a struct tm. In particular this means that $mon has the range 0..11 and $wday has the range 0..6 with sunday as day 0. Also, $year is the number of years since 1900, not simply the last two digits of the year.

If EXPR is omitted, does gmtime(time()).

In a scalar context, returns the ctime(3) value:

    $now_string = gmtime;  # e.g., "Thu Oct 13 04:54:34 1994"

Also see the timegm() function provided by the Time::Local module, and the strftime(3) function available via the POSIX module.

Source: Perl builtin functions
Copyright: Larry Wall, et al.
Next: goto LABEL

Previous: glob EXPR



(Corrections, notes, and links courtesy of RocketAware.com)


[Overview Topics]

Up to: Calendar and Time of Day




Rapid-Links: Search | About | Comments | Submit Path: RocketAware > Perl > perlfunc/gmtime.htm
RocketAware.com is a service of Mib Software
Copyright 2000, Forrest J. Cavalier III. All Rights Reserved.
We welcome submissions and comments