PHPackages                             jord-jd/php-dot-net-ticks - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jord-jd/php-dot-net-ticks

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jord-jd/php-dot-net-ticks
=========================

This package helps PHP developers work with and convert .NET ticks, a form of precise time measurement used by the .NET DateTime object.

v2.0.0(3mo ago)21LGPL-3.0-onlyPHP

Since Feb 7Pushed 3mo agoCompare

[ Source](https://github.com/Jord-JD/php-dot-net-ticks)[ Packagist](https://packagist.org/packages/jord-jd/php-dot-net-ticks)[ GitHub Sponsors](https://github.com/DivineOmega)[ RSS](/packages/jord-jd-php-dot-net-ticks/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

⏱ PHP .NET Ticks
================

[](#-php-net-ticks)

[![Build Status](https://camo.githubusercontent.com/f32ddbcf5e184068c41125c5de9071de17dcba82474778c057c634c7447bc1e9/68747470733a2f2f7472617669732d63692e6f72672f4a6f72642d4a442f7068702d646f742d6e65742d7469636b732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Jord-JD/php-dot-net-ticks)[![Coverage Status](https://camo.githubusercontent.com/fd77f233b8c20e21af469c68f963c147562b86f2c54dbbad1ba7da46f1af6917/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4a6f72642d4a442f7068702d646f742d6e65742d7469636b732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Jord-JD/php-dot-net-ticks?branch=master)[![StyleCI](https://camo.githubusercontent.com/19234daffe4de0d6a7c2f84d74dc2688e3ba99bee82ba176b31bfeb4155da476/68747470733a2f2f7374796c6563692e696f2f7265706f732f3132303632323332302f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/120622320)

This package helps PHP developers work with and convert .NET ticks, a form of precise time measurement used by the .NET `DateTime` object.

Features
--------

[](#features)

You can use this library to do the following, and more.

- Convert ticks to timestamp
- Convert ticks to `DateTime` object
- Convert ticks to `Carbon` date object
- Get the current time in ticks
- Convert timestamp to ticks

What are .NET ticks?
--------------------

[](#what-are-net-ticks)

> A single tick represents one hundred nanoseconds or one ten-millionth of a second. There are 10,000 ticks in a millisecond, or 10 million ticks in a second.

> The value of this property \[`DateTime.Ticks`\] represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001 (0:00:00 UTC on January 1, 0001, in the Gregorian calendar), which represents DateTime.MinValue. It does not include the number of ticks that are attributable to leap seconds.

*Source: [.NET API Reference: DateTime.Tick Property](https://msdn.microsoft.com/en-us/library/system.datetime.ticks(v=vs.110).aspx)*

Installation
------------

[](#installation)

The PHP .NET Ticks package can be easily installed using Composer. Just run the following command from the root of your project.

```
composer require jord-jd/php-dot-net-ticks

```

If you have never used the Composer dependency manager before, head to the [Composer website](https://getcomposer.org/) for more information on how to get started.

Usage
-----

[](#usage)

First you need to create a new `Ticks` object. This can be done in several ways.

```
use JordJD\DotNetTicks\Ticks;

// Current time
$ticks = new Ticks();

// Specific time in ticks
$ticks = new Ticks(636536021491253348);

// From timestamp
$ticks = Ticks::createFromTimestamp(1518005349);
```

You can then call methods on the `Ticks` object to retrieve or convert as necessary.

```
$ticks = $ticks->ticks();       // Ticks

$time = $ticks->timestamp();    // UNIX timstamp

$dateTime = $ticks->dateTime(); // PHP DateTime object
$carbon = $ticks->carbon();     // Carbon date object
```

If you wish, you can combine these two steps into one line, as shown in the examples below.

```
// Get current time in ticks
$nowInTicks = (new Ticks())->ticks();

// Convert ticks to timestamp
$timestamp = (new Ticks(636536021491253348))->timestamp();

// Convert timestamp to ticks
$ticks = Ticks::createFromTimestamp(1518005349)->ticks();
```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance82

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2929 days

Total

2

Last Release

93d ago

Major Versions

v1.0.0 → v2.0.02026-02-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/c580cdf7c14898fff179cdfc1085892091d5d2f49d917873a12365af9ac77c93?d=identicon)[Jord-JD](/maintainers/Jord-JD)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (9 commits)")

---

Tags

datedatetimedot-netdotnetphpphp-librarytime

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jord-jd-php-dot-net-ticks/health.svg)

```
[![Health](https://phpackages.com/badges/jord-jd-php-dot-net-ticks/health.svg)](https://phpackages.com/packages/jord-jd-php-dot-net-ticks)
```

###  Alternatives

[ashallendesign/short-url

A Laravel package for creating shortened URLs for your web apps.

1.4k1.9M4](/packages/ashallendesign-short-url)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)[intervention/zodiac

Zodiac Sign Calculator

58191.7k](/packages/intervention-zodiac)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[solspace/craft-calendar

The most powerful event management and calendaring plugin!

1830.8k1](/packages/solspace-craft-calendar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
