登录 注册
开发者工具网络与基础设施
16,581
Stars
—
Forks
0
Watchers
—
Open Issues
待补全
许可证
PHP
语言
—
创建时间
最近更新

项目能做什么

专为 DateTime 打造的简单 PHP API 扩展库。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# Carbon

[![Latest Stable Version](https://img.shields.io/packagist/v/nesbot/carbon.svg?style=flat-square)](https://packagist.org/packages/nesbot/carbon)
[![Total Downloads](https://img.shields.io/packagist/dt/nesbot/carbon.svg?style=flat-square)](https://packagist.org/packages/nesbot/carbon)
[![GitHub Actions](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FCarbonPHP%2Fcarbon%2Fbadge&style=flat-square&label=Build&logo=none)](https://github.com/CarbonPHP/carbon/actions)
[![codecov.io](https://img.shields.io/codecov/c/github/CarbonPHP/carbon.svg?style=flat-square)](https://codecov.io/github/CarbonPHP/carbon/actions?branch=master)

An international PHP extension for DateTime. [Documentation](https://carbonphp.github.io/carbon/)

> [!NOTE]  
> We're migrating the repository from [briannesbitt/Carbon](https://github.com/briannesbitt/Carbon) to [CarbonPHP/carbon](https://github.com/CarbonPHP/carbon),
> which means if you're looking specific issues/pull-requests, you may have to search both. No other impact as code on both will be kept up to date. 

```php
<?php

use Carbon\Carbon;

printf("Right now is %s", Carbon::now()->toDateTimeString());
printf("Right now in Vancouver is %s", Carbon::now('America/Vancouver'));  //implicit __toString()
$tomorrow = Carbon::now()->addDay();
$lastWeek = Carbon::now()->subWeek();

$officialDate = Carbon::now()->toRfc2822String();

$howOldAmI = Carbon::createFromDate(1975, 5, 21)->age;

$noonTodayLondonTime = Carbon::createFromTime(12, 0, 0, 'Europe/London');

$internetWillBlowUpOn = Carbon::create(2038, 01, 19, 3, 14, 7, 'GMT');

// Don't really want this to happen so mock now
Carbon::setTestNow(Carbon::createFromDate(2000, 1, 1));

// comparisons are always done in UTC
if (Carbon::now()->gte($internetWillBlowUpOn)) {
    die();
}

// Phew! Return to normal behaviour
Carbon::setTestNow();

if (Carbon::now()->isWeekend()) {
    echo 'Party!';
}
// Over 200 languages (and over 500 regional variants) supported:
echo Carbon::now()->subMinutes(2)->diffForHumans(); // '2 minutes ago'
echo Carbon::now()->subMinutes(2)->locale('zh_CN')->diffForHumans(); // '2分钟前'
echo Carbon::parse('2019-07-23 14:51')->isoFormat('LLLL'); // 'Tuesday, July 23, 2019 2:51 PM'
echo Carbon::parse('2019-07-23 14:51')->locale('fr_FR')->isoFormat('LLLL'); // 'mardi 23 juillet 2019 14:51'

// ... but also does 'from now', 'after' and 'before'
// rolling up to seconds, minutes, hours, days, months, years

$daysSinceEpoch = Carbon::createFromTimestamp(0)->diffInDays(); // something such as:
                                                                // 19817.6771
$daysUntilInternetBlowUp = $internetWillBlowUpOn->diffInDays(); // Negative value since it's in the future:
                                                                // -5037.4560

// Without parameter, difference is calculated from now, but doing $a->diff($b)
// it will count time from $a to $b.
Carbon::createFromTimestamp(0)->diffInDays($internetWill
阅读完整原文

项目深度分析 AI 生成

全球节假日与多时区复杂排程云服务 (SaaS / API)

产品构想基于 Carbon 的多语言与时间计算特性,构建面向跨国业务的节假日、交易日、工作日计算及定时调度云端 API 引擎,补充底层库缺少企业级动态日历数据的短板。
核心功能全球多国法定节假日与调休动态数据库、工作日计算接口、复杂 Cron/排程规则云端校验与推算引擎、与 Carbon 兼容的 SDK。
目标用户跨境电商平台、跨国考勤/HR 系统、跨国金融与物流系统的后端开发者及架构师。
难度/周期中等 · 1-2 个月 · 成本:轻量云服务器、全球节假日数据源维护成本。
收费模式API 阶梯调用计费(Freemium,按每月请求量分级订阅)。
竞争风险市场上已存在类似节假日服务,且数据维护具有地域政策变更的持续运营风险。
依据 AI推测

企业级开源合规与 LTS 商业支持分发

产品构想依托 Carbon 原厂/专家身份,通过 Tidelift 模式或自营通道,为依赖特定 PHP/Carbon 版本(如 PHP 7.x 遗留系统)的大型企业提供长期安全补丁与合规审计保障。
核心功能CVE 漏洞提前披露与修复、遗留老版本定制安全 Backport 补丁、SLA 技术支持渠道、合规证书输出。
目标用户银行、电信、传统大型跨国企业的合规部门及技术团队。
难度/周期高 · 持续运营 · 成本:安全专家维护成本、法务与商务沟通成本。
收费模式年度企业维护许可(Enterprise License / Support Contract)。
竞争风险需要直接维护者或核心团队背书(README 中已接入 Tidelift),独立第三方极难建立信任壁垒。
依据 已验证事实

文档/生态站点广告与定向商业赞助服务

产品构想利用 Carbon 极高的装机量与文档高频访问流量,规范化文档站、README 的广告展示位(如目前已存在的博彩/商业赞助展示)。
核心功能GitHub README 赞助商专属展示位、官方文档站点 Banner/侧边栏定向技术广告。
目标用户B2D 开发者工具商、云服务商、外包招聘平台、商业软件企业。
难度/周期低 · 即开即用(1-2 周接入商业化代理) · 成本:展示位审核与广告接入管理成本。
收费模式月度/季度广告赞助费用(Sponsorship Tiers / Direct Ad Placement)。
竞争风险低质广告(如现有 README 中的博彩链接)会损害开源声誉;完全依赖访问流量,缺乏产品化定价权。
依据 已验证事实
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
carbon-app/carbon 中文介绍暂未生成
:black_heart: Create and share beautiful images of your sour
36,144 JavaScript
carbon-language/carbon-lang 中文介绍暂未生成
Carbon Language's main repository: documents, design, implem
33,948 C++
fathyb/carbonyl 中文介绍暂未生成
Chromium running inside your terminal
19,596 Rust
carbon-design-system/carbon 中文介绍暂未生成
A design system built by IBM
9,614 TypeScript
mixn/carbon-now-cli 中文介绍暂未生成
🎨 Beautiful images of your code — from right inside your ter
6,032 TypeScript
dromara/carbon 中文介绍暂未生成
A simple, semantic and developer-friendly time package for
5,222 Go
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建时间待补全,最近推送 ,发布过 100 个 Release
社区活跃Star 16,581 / Fork 0 / Issue 0(数据支持,可自行核实)
许可证未检测到(需人工确认)
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。