Download the PHP package divineomega/php-dot-net-ticks without Composer
On this page you can find all versions of the php package divineomega/php-dot-net-ticks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download divineomega/php-dot-net-ticks
More information about divineomega/php-dot-net-ticks
Files in divineomega/php-dot-net-ticks
Package php-dot-net-ticks
Short Description This package helps PHP developers work with and convert .NET ticks, a form of precise time measurement used by the .NET DateTime object.
License LGPL-3.0-only
Informations about the package php-dot-net-ticks
⏱ PHP .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.
Features
You can use this library to do the following, and more.
- Convert ticks to timestamp
- Convert ticks to
DateTimeobject - Convert ticks to
Carbondate object - Get the current time in ticks
- Convert timestamp to 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
Installation
The PHP .NET Ticks package can be easily installed using Composer. Just run the following command from the root of your project.
If you have never used the Composer dependency manager before, head to the Composer website for more information on how to get started.
Usage
First you need to create a new Ticks object. This can be done in several ways.
You can then call methods on the Ticks object to retrieve or convert as necessary.
If you wish, you can combine these two steps into one line, as shown in the examples below.