承接 gbetts/ancient-dates 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gbetts/ancient-dates

最新稳定版本:v1.0.0

Composer 安装命令:

composer require gbetts/ancient-dates

包简介

A helper to format and get info from ancient and prehistoric dates

README 文档

README

A helper to format and get info from ancient and prehistoric dates for PHP.

When working with dates in code they typically follow the ISO 8601 date format (YYYY-MM-DD). This standard means BCE dates are represented with a minus sign before the year (e.g., -3000-01-01).

Typically date formatters will ignore the minus and it's up to you to format the date appropriately.

Normally, a user would expect to see these dates in a more readable format, such as 3000 BCE, or 5025 years ago

This package helps you convert ancient dates to these formats and provides additional information such as the geological period.

Installation

Install the package via composer:

composer require gbetts/ancient-dates

Usage

Initialise your date using the AncientDate class

use Gbetts\AncientDates\AncientDate

$date = new AncientDate('-155000000-01-01T00:00:00Z');

The following methods are available for the date object:

$date->toBceString() // 155 million years BCE
$date->yearsAgo() // 155002025
$date->period() // Jurassic

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-07