PHPackages                             themeisee/mssql-time-converter - 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. themeisee/mssql-time-converter

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

themeisee/mssql-time-converter
==============================

Converts float type to DateTime

323PHP

Since Aug 2Pushed 7y ago1 watchersCompare

[ Source](https://github.com/themaiby/mssql-time-converter)[ Packagist](https://packagist.org/packages/themeisee/mssql-time-converter)[ RSS](/packages/themeisee-mssql-time-converter/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (1)Used By (0)

mssql-time-converter
====================

[](#mssql-time-converter)

Converts float type to DateTime object. Uses in MSSQL, so you can make query

```
SELECT CAST(43243.5382623071 AS datetime) as human_time;
-- or
SELECT CAST(GETDATE() AS float) as float_time;
```

But without milliseconds yet

Usage
-----

[](#usage)

**Float to DateTime**

```
$converter = new MSSQLTimeConverter();
$MSDateTime = 43243.5382623071;
$humanDate = $converter->floatToDateTime($MSDateTime, 'Europe/Kiev');

echo $humanDate->format('Y-m-d H:i:s.u'); // 2018-05-25 12:55:05.000000
```

**DateTime to Float**

```
$timeNow = new DateTime('2018-05-25 12:55:05.000000', 'Europe/Kiev');
$converter = new MSSQLTimeConverter();

echo $converter->dateTimeToFloat($timeNow); // ~43243.5382623071
```

**If you want to convert only time**

```
$time = "12:55:05";
// You need to hardcore 1900-01-01. I hope it's temporary.
$dateTime = new DateTime("1900-01-01 " . $time, 'Europe/Kiev');
$converter = new MSSQLTimeConverter();

echo $converter->dateTimeToFloat($timeNow); // ~43243.5382623071
```

### TODO

[](#todo)

- take with milliseconds

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b9585e67dba5f70108b5d5d7f0ae0677e49099d45b58f74ab11a15d19406c5a1?d=identicon)[themaiby](/maintainers/themaiby)

---

Top Contributors

[![themaiby](https://avatars.githubusercontent.com/u/16966700?v=4)](https://github.com/themaiby "themaiby (28 commits)")

---

Tags

castdatetime-formatfloatmssqlphp

### Embed Badge

![Health badge](/badges/themeisee-mssql-time-converter/health.svg)

```
[![Health](https://phpackages.com/badges/themeisee-mssql-time-converter/health.svg)](https://phpackages.com/packages/themeisee-mssql-time-converter)
```

PHPackages © 2026

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