Skip to content

Time

A value object representing a timestamp

This class exists for type-safety purposes, to ensure that timestamps used by ramsey/uuid are truly timestamp integers and not some other kind of string or integer.

  • Full name: \Ramsey\Uuid\Type\Time
  • This class is marked as final and can't be subclassed
  • This class implements: \Ramsey\Uuid\Type\TypeInterface
  • This class is a Final class

Properties

seconds

private \Ramsey\Uuid\Type\Integer $seconds

microseconds

private \Ramsey\Uuid\Type\Integer $microseconds

Methods

__construct

public __construct(float|int|string|\Ramsey\Uuid\Type\Integer $seconds, float|int|string|\Ramsey\Uuid\Type\Integer $microseconds): mixed

Parameters:

Parameter Type Description
$seconds float|int|string|\Ramsey\Uuid\Type\Integer
$microseconds float|int|string|\Ramsey\Uuid\Type\Integer

getSeconds

public getSeconds(): \Ramsey\Uuid\Type\Integer

getMicroseconds

public getMicroseconds(): \Ramsey\Uuid\Type\Integer

toString

public toString(): string

__toString

public __toString(): string

jsonSerialize

public jsonSerialize(): string[]

serialize

public serialize(): string

__serialize

public __serialize(): array{seconds: string, microseconds: string}

unserialize

Constructs the object from a serialized string representation

public unserialize(string $data): void

Parameters:

Parameter Type Description
$data string The serialized string representation of the object

__unserialize

public __unserialize(array{seconds?: string, microseconds?: string} $data): void

Parameters:

Parameter Type Description
$data array{seconds?: string, microseconds?: string}


Automatically generated on 2025-03-18