Function __global->to_epoch_interval_index

Definitions

sources/temporal.php

  • Convert an epoch timestamp to an epoch interval index.In other words, this will return the number of *full* $intervals from $epoch to $timestamp.Note that when using Unix epoch, weeks start on a Thursday given that is when epoch starts. Set $epoch to 345600 to start on a Monday, or 259200 for Sunday.
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Return: int

Parameters

Name Type Default Set Range Description
$timestamp TIME required parameter N/A N/A The timestamp which we want to convert to an interval index
$interval ID_TEXT required parameter N/A N/A The interval we want to use
$epoch TIME 0 N/A N/A Define our own epoch relative to the Unix epoch to use in this calculation instead

Return

  • The index of the interval at which $timestamp is located
  • Type: integer
  • Set: N/A
  • Range: N/A