


A simple question, how to convert the timestamp to Y-M-D in this case?
The above is the output timestamp in AJAX. I don’t know how to do it, so I tried to convert it in PHP
But why can’t I rotate like this in the model or C? When output, this array becomes this field, and other fields are lost
I found out from the answer of an expert above that you can use the mysql statement to convert the addtime into time format in the linked list. But in TP, if you add that kind of conversion statement after the field field, will an error be reported? Does anyone know how to write without getting an error?
I know I am a bit mentally retarded with this question, so I humbly seek advice from an expert, thank you
Reply content:
The above is the output timestamp in AJAX. I don’t know how to do it, so I tried to convert it in PHP
But why can’t I rotate like this in the model or C? When output, this array becomes this field, and other fields are lost
I found out from the answer of an expert above that you can use the mysql statement to convert the addtime into time format in the linked list. But in TP, if you add that kind of conversion statement after the field field, will an error be reported? Does anyone know how to write without getting an error?
I know I am a bit mentally retarded with this question, so I humbly seek advice from an expert, thank you
<code>// zero padding, 补0 function zp(n){ return n<10?['0',n].join(''):n; } // ts为13位的时间戮(ms), 如果是秒,乖1000 function ts_date(ts, d){ d = new Date(+ts); // +号, 若为字符串转为数字 return [d.getFullYear(), zp(d.getMonth()+1), zp(d.getDate())].join("-")+" "+[zp(d.getHours()), zp(d.getMinutes()), zp(d.getSeconds())].join(":"); }</code>
<code>+ ts_date(v.addtime) + '</span>';</code>
$pinluns is a two-dimensional array. You can print it and take a look. To format the timestamp, you can loop $pinluns to do it, or you can use MySQL data formatting when checking the database without using PHP. Formatted.
It is recommended to turn the handlebar on the front.
But this won’t work. The array queried by select is a two-dimensional array, and you need to reassemble the data.
<code>->find()才是查询一条数据; 如果->select() 那就是$pinluns[0]['addtime'];</code>
The selected result is a two-dimensional array. You need to use foreach to traverse the array and add addtime
moment

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

In this chapter, we are going to learn the following topics related to routing ?

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Validator can be created by adding the following two lines in the controller.
