05 Jan 2004 21:48:12 UTC
- Distribution: Time-Concise
- Module version: 1.1
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (2300 / 0 / 0)
- KwaliteeBus factor: 0
- 94.44% Coverage
- License: unknown
- Activity24 month
- Download (2.55KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:1 non-PAUSE userCWEST Casey West
Time::Concise - Convert to and from concise duration formats.
use Time::Concise; my $seconds = from_concise "5y4d3h2m1s"; # 158141171 my $concise = to_concise 158141171; # 5y4d3h2m1s
Time::Concise exports two functions by default,
The term concise was borrowed from Time::Duration.
The format is an integer followed immediatley by its duration identifier. White-space will be ignored.
The following table explains the format.
identifier duration ---------- -------- y year d day h hour m minute s second
- to_concise $seconds
This function requires one argument, an integer number of seconds, and returns a concise string representation of the duration.
If the input is not an integer this function returns
- from_concise $concise
This function requires one argument, a concise string representation of the duration, and returns the number of seconds in the duration.
If the concise string contains characters outside those represented in a concise duration string this function will return
Casey West, <email@example.com>.
Copyright (c) 2004 Casey West. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Time::Concise, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Time::Concise
For more information on module installation, please visit the detailed CPAN module installation guide.