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


Manual Reference Pages  -  SORT::KEY::DATETIME (3)

.ds Aq ’

NAME

Sort::Key::DateTime - Perl extension for sorting objects by some DateTime key

CONTENTS

SYNOPSIS



  use Sort::Key::DateTime qw(dtkeysort);
  my @sorted = dtkeysort { $_->date } @meetings;



DESCRIPTION

Sort::Key::DateTime allows to sort objects by some (calculated) key of type DateTime.

    EXPORTS

dtkeysort { CALC_DT_KEY } @array returns the elements on @array sorted by the DateTime key calculated applying { CALC_DT_KEY } to them.

Inside { CALC_DT_KEY }, the object is available as $_.

NOTE: sorting order is undefined when floating and non floating DateTime keys are mixed.

rdtkeysort { CALC_DT_KEY } @array sorted @array in descending order
dtsort(@array)
rdtsort(@array) sort an array of DateTime objects in ascending and descending order respectively.

Example:



  my @sorted = dtsort @unsorted;



dtkeysort_inplace { CALC_DT_KEY } @array
rdtkeysort_inplace { CALC_DT_KEY } @array
dtsort @array
rdtsort @array sort @array in place.
mkkey_datetime($dt) generates string sorting keys for DateTime objects

SEE ALSO

Sort::Key, Sort::Key::Maker, perl sort function docs.

DateTime module documentation and FAQ available from the DateTime project web site at <http://datetime.perl.org/>

AUTHOR

Salvador Fandinõ, <sfandino@yahoo.com<gt>

COPYRIGHT AND LICENSE

Copyright (C) 2005, 2010 by Salvador Fandinõ

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.

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


perl v5.20.3 SORT::KEY::DATETIME (3) 2010-04-24

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