PubNub LogoDocs
SupportContact SalesLoginTry Our APIs

›API Reference

pHP

  • Getting Started
  • API Reference

    • Configuration
    • Publish & Subscribe
    • Presence
    • Access Manager
    • Channel Groups
    • Message Persistence
    • Mobile Push
    • Objects
    • Miscellaneous
  • Status Events
  • Troubleshooting
  • Change Log
  • Feature Support
  • Platform Support

Utility Methods API for PubNub PHP SDK

The methods on this page are utility methods that don't fit into other categories.

Time

Description

This function will return a 17 digit precision Unix epoch.

The timetoken is constructed using the following algorithm:
timetoken = (Unix epoch time in seconds) * 10000000

Example of creating a timetoken for a specific time and date

08/19/2013 @ 9:20pm in UTC = 1376961606
timetoken = 1376961606 * 10000000
timetoken = 13769616060000000

Method(s)

To fetch Time you can use the following method(s) in PHP V4 SDK:

  1. $pubnub->time()->sync();
    

    This method doesn't take any argument.

Basic Usage

Get PubNub Timetoken

$result = $pubnub->time()
              ->sync();

print_r($result);

Response

MethodTypeDescription
getTimetoken()IntegerReturns a date representation of current timetoken.
← ObjectsStatus Events →
  • Time
    • Description
    • Method(s)
    • Basic Usage
    • Response
© PubNub Inc. - Privacy Policy