Welcome Guest, Not a member yet? Register   Sign In
Convert timestamp to tick
#11

Here are a couple of methods you can play with:

PHP Code:
// -----------------------------------------------------------------------

/**
 *  Converting a Unix timestamp to DateTime Ticks
 *
 * Equation: (UNIX_TIMESTAMP * 10000000) + 621355968000000000
 */
if ( ! function_exists('timeToTicks'))
{
 
   function timeToTicks($time)
 
   {
 
       return number_format(($time 10000000) + 6213559680000000000'.''');
 
   }
}

// -----------------------------------------------------------------------

/**
 * Converting DateTime Ticks to a Unix timestamp in PHP
 *
 * Equation: (TICKS – 621355968000000000) / 10000000
 */
if ( ! function_exists('ticksToTime'))
{
 
   function ticksToTime($ticks)
 
   {
 
       return ($ticks 621355968000000000) / 10000000;
 
   }


Good luck...
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
Convert timestamp to tick - by omid_student - 03-07-2018, 06:14 AM
RE: Convert timestamp to tick - by omid_student - 03-07-2018, 06:18 AM
RE: Convert timestamp to tick - by Muzikant - 03-07-2018, 06:42 AM
RE: Convert timestamp to tick - by omid_student - 03-07-2018, 01:29 PM
RE: Convert timestamp to tick - by omid_student - 03-07-2018, 01:32 PM
RE: Convert timestamp to tick - by omid_student - 03-07-2018, 01:37 PM
RE: Convert timestamp to tick - by Muzikant - 03-07-2018, 06:40 AM
RE: Convert timestamp to tick - by InsiteFX - 03-08-2018, 04:50 AM
RE: Convert timestamp to tick - by omid_student - 03-08-2018, 09:41 AM
RE: Convert timestamp to tick - by InsiteFX - 03-08-2018, 10:07 AM
RE: Convert timestamp to tick - by omid_student - 03-08-2018, 10:51 PM
RE: Convert timestamp to tick - by InsiteFX - 03-08-2018, 03:45 PM
RE: Convert timestamp to tick - by omid_student - 03-08-2018, 10:51 PM
RE: Convert timestamp to tick - by InsiteFX - 03-09-2018, 06:15 AM
RE: Convert timestamp to tick - by omid_student - 03-09-2018, 07:00 AM
RE: Convert timestamp to tick - by InsiteFX - 03-09-2018, 02:00 PM
RE: Convert timestamp to tick - by omid_student - 03-09-2018, 10:47 PM
RE: Convert timestamp to tick - by omid_student - 03-09-2018, 11:58 PM
RE: Convert timestamp to tick - by omid_student - 03-10-2018, 02:01 AM
RE: Convert timestamp to tick - by InsiteFX - 03-10-2018, 07:18 AM
RE: Convert timestamp to tick - by InsiteFX - 03-13-2018, 03:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB