


The iOS system has format requirements for the new Date() method in js
let dt = new Date("2019-07-24 19:57") // dt会返回valid Date
The correct way to write it should be
let dt = new Date("2019/07/24 19:57")
In fact, most of the date formats in the process are 2019-07- 24, so in the actual application process, it is necessary to use regular expressions to preprocess the string
let tm = "2019-07-24 19:57" let dt = new Date(tm.replace(/-/g,'/'))
During the development of the small program, a date conversion method was used, but it didn’t work on Apple’s mobile phone. I searched online. I just discovered this problem and recorded the
recommended tutorial: "WeChat Mini Program"
The above is the detailed content of What should I do if the new Date() method of the applet fails?. For more information, please follow other related articles on the PHP Chinese website!

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

SublimeText3 Chinese version
Chinese version, very easy to use

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment