new($language) or new(%hash)
As usual, this class method returns an instance of the class.
The method can receive either a single parameter specifying the language, or a hash with various parameters (note: not a hash reference, a real hash, in other words a list with an even number of elements). The hash may contain the following keys:
Given baby talk, this method will return a new DateTime object.
For some languages (en, de, es, fr and it) parsing uses a regexp on various synonyms for big and little. For all other languages, the module only understands the same phrase that it would give using format_datetime().
If given baby talk that it cant parse, this method may either die or get confused. Dont try things like The big and little hands are on the six and five, respectively.
Given a DateTime object, this methods returns baby talk. Remember though that babies only understand time (even then, without am/pm)
When given a language, this method sets its language appropriately.
This method returns the current language. (After processing as above)
This method return a list of known languages.
Support for this module is provided via the email@example.com email list. See <http://lists.perl.org/> for more details.
No known bug, only known issues.
As Abigail said in his module Acme::Time::Baby, the Baby part of the module name is a misnomer, because you have to be at least a toddler to read a clockface and describe it in a complete sentence with a correct syntax (even if a simple one). On the other hand, the common phrase is not toddler talk, but baby talk. Therefore Acme::Time::Baby keeps its name Acme::Time::Baby and DateTime::Format::Baby keeps its name DateTime::Format::Baby.
Baby talk does not implement years, months, days or even AM/PM. Its more for amusement than anything else.
You may think that a roundtrip like this:
my $string = $baby->format_datetime($datetime); my $new_datetime = $baby->parse_datetime($string);
should give the same value with a 5-minute fuzz factor. This is not the case for two reasons. As stated above, babies (or toddlers) do not understand the AM/PM factor. So there can be a 12-hour skip in the roundtrip. The second reason is that when the time is a few minutes past the half-hour (say xx:31 or xx:32), the small hand is not on the same number as when the time is exactly on the half-hour. So there is a 1-hour jump forward during such a round-trip.
As already said above, baby talk does not include convoluted sentences as: The big and little hands are on the six and five, respectively or Both hands are on the five.
Rick Measham <firstname.lastname@example.org> (BigLug on PerlMonks)
Co-maintainer: Jean Forget (JFORGET at cpan dot org)
Abigails original module contained a language list that is plagarised here. See the documentation for Acme::Time::Baby for language acknowledgements.
If you have additional language data for this module, please also pass it on to Abigail. This module is not meant to replace the original. Rather it is a DateTime port of that module.
This program is copyright 2003, 2015, 2016 by Rick Measham and Jean Forget
This program is based on code that is copyright 2002 by Abigail.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
email@example.com mailing list
|perl v5.20.3||DATETIME::FORMAT::BABY (3)||2016-01-27|