- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我在尝试使用时间戳创建新的 DateTime 对象时遇到了这个构造错误:
Exception: DateTime::_construct(): Failed to parse time string (1372622987) at position 8 (8): Unexpected character in DateTime->_construct()
对象创建代码为:
$start_date = new DateTime( "@{$dbResult->db_timestamp}" );
其中 $dbResult->db_timestamp 是从数据库中获取的有效 unix 时间戳。有问题的时间戳是:
1372622987
如果传递的格式无效,我会理解这个错误,但这是一个真正的时间戳。
这很奇怪的原因是:我运行了一个脚本来创建一个新的 DateTime 对象,并将时间戳作为硬编码值传入,并且没有报告任何错误。
这似乎是一次性的,但如果有的话,我需要一个解释,因为我不能再发生这种情况。
最佳答案
如果你硬编码,你应该使用 setTimestamp:
$start_date = new DateTime();
$start_date->setTimestamp(1372622987);
在你的情况下
$start_date = new DateTime();
$start_date->setTimestamp($dbResult->db_timestamp);
关于PHP DateTime __construct() 无法解析位置 x 处的时间字符串 (xxxxxxxx),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17427503/
使用 编译工作流Visual Studio 2010 和 .Net 框架 3.0 结果是 CSC 错误: “资源标识符 xxxxxxxx 已在此程序集中使用” 其中 xxxxxxxx 是我的项目中的工
我的 View 的背景颜色是#FFFFFFFF。我想通过代码得到这个。我不想只将 #FFFFFFFF 放入方法中,因为我将通过代码更改背景,因此该值将一直更改。 public void toggleE
我想通过管理员端的多项选择向选定的用户发送短信,但是,在管理员完成选择后,我无法从 select_users 字段中获取值。请帮我解决这个问题。 这是我的代码 表单.py class SendSMSF
FATAL: Remote call on Harris MacBook Pro failed java.lang.NoClassDefFoundError: Could not initialize
我正在尝试访问 Linux 中 am335x 处理器上的给定内存区域。这个想法是首先指定物理地址,然后使用 ioremap 访问所述地址。我已经在谷歌上搜索这个问题一段时间了,但似乎找不到任何好的解决
我是这个主题的新手,我有一个从数据库中的表中获取数据的下拉列表,当我选择另一个选项并保存时,给我:违反完整性约束: 1048 列 'department_id' 不能为空(SQL:更新 users 设
我正在使用 jQuery Validate 验证表单。 为了验证我所做的电话号码字段: 电话号码应该写成01x-xxxxxxxx var phonereg = /^[0-9]{3}\-[0-9]{7}
Google 云端硬盘共享对话框突然停止在我们与 Google 云端硬盘集成的应用程序上运行。查看它,这是调用 showSettingsDialog 时出现的消息: 我已经检查过的事情: 通过 Chr
我在尝试使用时间戳创建新的 DateTime 对象时遇到了这个构造错误: Exception: DateTime::_construct(): Failed to parse time string
我在尝试使用时间戳创建新的 DateTime 对象时遇到了这个构造错误: Exception: DateTime::_construct(): Failed to parse time string
我正在努力解决将 Android Studio 连接到我的 Google Pixel 2 的问题。 当我将手机插入笔记本电脑时,Android Studio 现在可以识别物理设备并在设备下拉列表中显示
我收到此错误,需要知道如何登录到数据库并终止连接。我正在从一台计算机进行连接,但看不出我怎么会超出资源。 最佳答案 我很确定你有免费计划,这只允许几个同时连接到数据库。您应该升级数据库计划,然后它才能
我正在尝试将文本文件上传到我的 Dropbox,但 list 中显示错误。这是我的 list 文件和logcat错误,我做错了什么,有人可以帮助我吗...
我在尝试使用应用程序加载器在 testflight 上上传 ipa 时收到无效的 AdamId:XXXXXXXX。 这里有一些更详细的信息: 最佳答案 我遇到此错误是因为我在 iTunes Conne
我正在尝试将文本文件上传到我的 Dropbox,但它在 list 中显示错误。这是我的Manifest 文件 和logcat 错误,我做错了什么任何人都可以帮助我...
使用执行器重新启动 Spring Boot 应用程序后,我们无法启动该应用程序。 我们有 Spring Boot 应用程序,我们想要实现一个可以使用执行器重新启动应用程序的功能。应用程序能够运行,但是
我正在尝试在 iOS 应用程序的跑道应用程序中创建一个新项目。以下代码行按照跑道中的文档进行,但我遇到了 403 错误,主题为错误消息。我假设我需要将 session 验证为应用程序,因为我认为它将使
当我尝试在数据库中插入数据时出现以下错误。 ORA-01691: unable to extend lob segment XXXXXX by 8192 in tablespace USERS 我正在
我刚刚升级到 cabal 1.22.0.0。我创建了一个全新沙箱,并添加了另一个本地包的链接,如下所示: cabal sandbox add-source /home/amy/néal/créatúr
我需要将这六个字段保存在同一列中,但不在同一行和同一单元格中。每个字段都有默认的 GUID。所以我决定将默认的 GUID 放在一个列表中,将字段放在一个列表中,并在我们想要的地方调用该特定列表的对象。
我是一名优秀的程序员,十分优秀!