2017 © Pedro Peláez
 

library juration-php

Duration string to time in seconds parser

image

bagf/juration-php

Duration string to time in seconds parser

  • Saturday, May 27, 2017
  • by bagf
  • Repository
  • 0 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Juration PHP Library

PHP version of the Dom Christie's javascript library: juration-js, (*1)

This library parses text and extracts the duration as seconds integer but unlike the javascript version it does not use regular expressions to match time patterns so helpful pull requests will be appreciated!, (*2)

Installation

composer require bagf/juration-php

Testing

composer install
composer test

Usage

Juration\Juration::parse('2min'); // 120
Juration\Juration::parse('2min and 1hr'); // 3720
Juration\Juration::stringify(12); // 12 secs
Juration\Juration::stringify(184); // 3 mins 4 secs
Juration\Juration::stringify(8400); // 2 hrs 20 mins
Juration\Juration::stringify(15854400); // 6 mths 1 day

The Versions

27/05 2017

dev-master

9999999-dev

Duration string to time in seconds parser

  Sources   Download

The Development Requires

27/05 2017

0.0.1

0.0.1.0

Duration string to time in seconds parser

  Sources   Download

The Development Requires