Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
Created non BCMath version
Browse files Browse the repository at this point in the history
Created a non-BCMath version of snowflake2utcms. Heroku doesn't support BCMath, and this works.
  • Loading branch information
PanMan committed May 28, 2013
1 parent cee62a7 commit 17aa339
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions php/snowflake.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ function snowflake2utcms($sf)
return bcadd(bcdiv($sf, '4194304'), '1288834974657');
}

function snowflake2utcms_nonbc($sf)
{
//Non BCMath version
return number_format((($sf/'4194304')+ '1288834974657'),0,'.','');
}


function str2utc($s)
{
return strtotime($s); // , "%a %b %d %H:%M:%S +0000 %Y");
Expand Down

0 comments on commit 17aa339

Please sign in to comment.