valorin / timeparser
Simple PHP class for parsing time values entered by users in a wide range of formats.
Installs: 262
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
pkg:composer/valorin/timeparser
Requires
Requires (Dev)
README
Simple PHP class for parsing time values entered by users in a wide range of formats.
Installation
Install with composer:
composer require valorin/timeparser
Usage
Add a use
namespace declaration to your class:
use Valorin\TimeParser\TimeParser;
Set the required output format, and run the ::parse()
function:
TimeParser::setFormat(TimeParser::FORMAT24);
$time = TimeParser::parse("09:32 am");