Pionia Core

Rounding

Trait Rounding.

Round, ceil, floor units.

Depends on the following methods:

Table of Contents

Methods

ceil()  : static
Ceil the current instance second with given precision if specified.
ceilUnit()  : static
Ceil the current instance at the given unit with given precision if specified.
ceilWeek()  : static
Ceil the current instance week.
copy()  : void
floor()  : static
Round the current instance second with given precision if specified.
floorUnit()  : static
Truncate the current instance at the given unit with given precision if specified.
floorWeek()  : static
Truncate the current instance week.
round()  : static
Round the current instance second with given precision if specified.
roundUnit()  : static
Round the current instance at the given unit with given precision if specified and the given function.
roundWeek()  : static
Round the current instance week.
startOfWeek()  : void

Methods

ceil()

Ceil the current instance second with given precision if specified.

public ceil([DateInterval|string|float|int $precision = 1 ]) : static
Parameters
$precision : DateInterval|string|float|int = 1
Return values
static

ceilUnit()

Ceil the current instance at the given unit with given precision if specified.

public ceilUnit(string $unit[, DateInterval|string|float|int $precision = 1 ]) : static
Parameters
$unit : string
$precision : DateInterval|string|float|int = 1
Return values
static

ceilWeek()

Ceil the current instance week.

public ceilWeek([WeekDay|int|null $weekStartsAt = null ]) : static
Parameters
$weekStartsAt : WeekDay|int|null = null

optional start allow you to specify the day of week to use to start the week

Return values
static

floor()

Round the current instance second with given precision if specified.

public floor([DateInterval|string|float|int $precision = 1 ]) : static
Parameters
$precision : DateInterval|string|float|int = 1
Return values
static

floorUnit()

Truncate the current instance at the given unit with given precision if specified.

public floorUnit(string $unit[, DateInterval|string|float|int $precision = 1 ]) : static
Parameters
$unit : string
$precision : DateInterval|string|float|int = 1
Return values
static

floorWeek()

Truncate the current instance week.

public floorWeek([WeekDay|int|null $weekStartsAt = null ]) : static
Parameters
$weekStartsAt : WeekDay|int|null = null

optional start allow you to specify the day of week to use to start the week

Return values
static

round()

Round the current instance second with given precision if specified.

public round([DateInterval|string|float|int $precision = 1 ][, callable|string $function = 'round' ]) : static
Parameters
$precision : DateInterval|string|float|int = 1
$function : callable|string = 'round'
Return values
static

roundUnit()

Round the current instance at the given unit with given precision if specified and the given function.

public roundUnit(string $unit[, DateInterval|string|float|int $precision = 1 ][, callable|string $function = 'round' ]) : static
Parameters
$unit : string
$precision : DateInterval|string|float|int = 1
$function : callable|string = 'round'
Return values
static

roundWeek()

Round the current instance week.

public roundWeek([WeekDay|int|null $weekStartsAt = null ]) : static
Parameters
$weekStartsAt : WeekDay|int|null = null

optional start allow you to specify the day of week to use to start the week

Return values
static

startOfWeek()

public static startOfWeek(int $weekStartsAt = null) : void
Parameters
$weekStartsAt = null : int

        
On this page

Search results