GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
POSIX::strptime(3) User Contributed Perl Documentation POSIX::strptime(3)

POSIX::strptime - Perl extension to the POSIX date parsing strptime(3) function

 ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = POSIX::strptime("string", "Format");

Perl interface to strptime(3)

strptime
 ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday) = POSIX::strptime(string, format);
    

The result for any value not extracted is not defined. Some platforms may reliably return "undef", but this is dependent on the strptime(3) function in the underlying C library.

For example, only the following fields may be relied upon:

 my ($min, $hour) = ( POSIX::strptime( "01:23", '%H:%M' ) )[1,2];
 
 my ($mday, $mon, $year) = ( POSIX::strptime( "2010/07/16", '%Y/%m/%d' ) )[3,4,5];
    

Furthermore, not all platforms will set the $wday and $yday elements. If these values are required, use "mktime" and "gmtime":

 use POSIX qw( mktime );
 use POSIX::strptime qw( strptime );

 my ($mday, $mon, $year) = ( POSIX::strptime( "2010/07/16", '%Y/%m/%d' ) )[3,4,5];
 my $wday = ( gmtime mktime 0, 0, 0, $mday, $mon, $year )[6];
    

strptime(3)

Philippe M. Chiasson <gozer@cpan.org> Kim Scheibel <kim@scheibel.co.uk>

http://svn.ectoplasm.org/projects/perl/POSIX-strptime/trunk/

Copyright 2005 by Philippe M. Chiasson <gozer@cpan.org>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html

2015-11-11 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.