我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

将欧洲时间格式转换为时间戳

What is the most efficient way to convert a given European formatted date (DD/MM/YY) to the correct timestamp?

Example: 10/11/12 should output 1352505600 as the 10th November 2012, and not the October 11th 2012

DateTime::createFromFormat()

$date = DateTime::createFromFormat('d/m/y', $eu_date);
echo $date->format("U");

http://php.net/manual/en/function.date.php

Use the 2nd optional variable to the date function to feed it the unix timestamp

近期文章

  • 带数组的字符串插值
  • 验证码无法使用php工作
  • 在codeigniter中调用ajax后重新生成新的会话ID
  • 如何在php中为soapclient构建KeyValuePair
  • php - 如何能够ajax发布并从此脚本返回?
  • 为特殊字符的Excel创建CSV文件
  • PHP脚本运行缓慢,但服务器CPU空闲
  • 使用Jquery Tree Plugin配置ul li标签
  • 星号。 PHP。 如果我知道SIP,如何获得电话号码?
  • Wordpress函数in_category无法按预期工作
  • PHP的mcrypt_encrypt和openssl命令行输出不同的密码
  • jQuery UI对话框,AJAX没有第二次运行点击功能
  • 使用LIKE语句执行时PDO的疯狂行为
  • 如何在网页上显示由PHP调用的java代码生成的图像?
  • php tidy none break space
  • 元刷新不会刷新
  • Apache Bench:为什么这么多503s?
  • Magento I-Banner - 无法设置“启用”
  • 实现自动建议的方法
  • 将microsoft world web app添加到网站 - 或在线预览文档。

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华