Skip to content

Instantly share code, notes, and snippets.

@ishida
Created May 9, 2012 13:47
Show Gist options
  • Save ishida/2644607 to your computer and use it in GitHub Desktop.
Save ishida/2644607 to your computer and use it in GitHub Desktop.
Get UNIX time
+ (UInt64)getEpochSeconds
{
return (UInt64)floor(CFAbsoluteTimeGetCurrent() + kCFAbsoluteTimeIntervalSince1970);
}
+ (UInt64)getEpochMilliSeconds
{
return (UInt64)floor((CFAbsoluteTimeGetCurrent() + kCFAbsoluteTimeIntervalSince1970) * 1000.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment