PHP Classes

File: tests/functions.php

Recommend this page to a friend!
  Classes of Chun-Sheng, Li   PHP UUID Generator V1   tests/functions.php   Download  
File: tests/functions.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP UUID Generator V1
Generate a RFC 4122-compliant unique identifier
Author: By
Last change:
Date: 1 year ago
Size: 248 bytes
 

Contents

Class file image Download
<?php

namespace UUID\tests;

function
convertNSecToMicrotimeTimestamp($nsec)
{
   
$sec = (int)($nsec / 1000000000);
   
$usec = str_pad((int)($nsec % 1000000000), 9, '0', STR_PAD_LEFT);
    return
sprintf('0.%s %d', substr($usec, 0, 6), $sec);
}