shapecode/doctrine-dbal-datetimeutc 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

shapecode/doctrine-dbal-datetimeutc

Composer 安装命令:

composer require shapecode/doctrine-dbal-datetimeutc

包简介

A custom Doctine DBAL type to use PHP DateTime objects set to the UTC timezone.

README 文档

README

paypal

PHP Version Latest Stable Version Latest Unstable Version Total Downloads Monthly Downloads Daily Downloads License

A Doctrine DBAL Custom Mapping Type allowing the use of PHP DateTime objects automatically set to the UTC timezone.

Databases suck at timezones. The best way to deal with this is to store the date and time in UTC and separately store the timezone that should be used for display purposes. By default, PHP will create DateTime objects set the server's timezone. This custom type overrides this to set the timezone to UTC, allowing you to later convert to the proper timezone for display.

Install via composer:

composer req shapecode/doctrine-dbal-datetimeutc

Add the custom type before instantiating your entity manager:

use Doctrine\DBAL\Types\Type;
use Shapecode\Doctrine\DBAL\Types\DateTimeUTCType;

Type::addType(DateTimeUTCType::DATETIMEUTC, DateTimeUTCType::class);

Enjoy!

统计信息

  • 总下载量: 2.25k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 4
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固