我在 Postgres 上使用 Doctrine2。在一张表中,我有两种不同的日期类型:birthdate:date和created_at:datetimetz. 两者都成为 DateTime 对象,但具有不同的timezone_type. 以下是清单:
created_at 日期时间:
DateTime Object
(
[date] => 2013-04-18 11:54:34
[timezone_type] => 1
[timezone] => +02:00
)
birthdate 日期:
DateTime Object
(
[date] => 1970-01-01 00:00:00
[timezone_type] => 3
[timezone] => Europe/Berlin
)
我需要以同样的方式格式化我的对象。两者都应该有timezone_type=3。
我怎样才能做到这一点?