Js intercepts the string to get the desired character?

21:21:21 on 2018-07-03 I want to take this string 03 and 21:21:21 and store it in other variables

I tried to use the rules, but I couldn"t get it out of the rules, so I had to ask for help

.
Mar.25,2021

var str="2018/07/03 21:21:21"
console.log(str.split(" ")[1])//21:21:21
console.log(str.split(" ")[0].split("/")[2])//03

this is date data, which can be extracted by formatting it as a time type data without regular expressions. And it is more accurate to deal with it, and it is more convenient to use numbers later.


  

it's safer to convert to time processing

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e583d4-65aad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e583d4-65aad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?