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

PHP日期操作

I need to get previous 30 days from a specific date which is available from database(eg: 2010-05-23 12:36:29).I am try it by using

date('d', strtotime("-30 days"))

Which is getting the currect answer what i looking for but it is not help me to enter date from database.Please help me to solve the issue.

Step by step:

$db_string =           "2010-05-23 12:36:26";
$db_timestamp =        strtotime($db_string);
$db_timestamp_30days = strtotime("-30 days", $db_timestamp);

$readable_date = date("d", $db_timestamp_30days);

近期文章

  • 数据库自己创建的用户登录不上怎么办呜呜呜
  • wifi图标无法显示
  • c语言 出现重复打印的情况
  • Exception in thread "main" java.lang.Error: 无法解析的编译问题:
  • C语言距离的解决方法
  • php通过字符串调用标准函数
  • minecraftserver.jar
  • mingw的下载问题
  • 求前缀表达式,图片所示只是到那里出错,可能还有其他
  • FXGL怎么设置实体层级
  • 最大值有两个该如何输出?
  • DS平衡二叉树练习AVL
  • 如何在preg_match中允许utf-8字符集?
  • 这个程序是c语言吗, 有没有使用链表
  • cvzon使用报错找不到原因
  • 求助CentOS安装ReviewBoard5.0.1详细步骤
  • 用anaconda安装pytorch时报错
  • 谁来解释一下下面的问题呀?(希望详细解释)
  • python-基于分布式并行的小概率事件的几何分布模拟
  • 如何从MySQL查询中获取PHP变量?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华