Represents a Duration type.

Example:

use Google\Cloud\Core\Duration;

$seconds = 100;
$nanoSeconds = 1000;
$duration = new Duration($seconds, $nanoSeconds);
// Duration objects can be cast to json-encoded strings.
echo (string) $duration;
CloneableInstantiable
Constants
public Google\Cloud\Core\Duration::TYPE = 'DURATION'
Methods
public __construct( $seconds, $nanos = 0)
 
    public __toString()
     

    Format the value as a string.

    • return string
    • access private
    public formatAsString()
     

    Format the value as a string.

    Example:

    echo $duration->formatAsString();
    
    • return string
    public get()
     

    Get the duration

    Example:

    $res = $duration->get();
    
    • return array
    Properties
    private $nanos
     
    • var int
    private $seconds
     
    • var int
    © 2020 Bruce Wells
    Search Namespaces \ Classes
    ConfigurationNumbers (0-9.) only