希望你在这些时候一切都好。
我遇到了一个问题,希望你有更多的知识。
使用 'jq' 我想更改所有日期,例如。19731013(字符串)到 1973-10-13
[
{
"Mail": "john@example.com",
"Name": "Smith",
"Employee_Number": "000555",
"First_Name": "John",
"Company": "ACME",
"Department": null,
"Employment_Status": "Retiree",
"Start_Date": "19770516",
"Function_Start_Date": "19770516",
"Group_Phone": "",
"Job_Title": "Operations Manager Warehousing",
"Sub_Group": "Exempts",
"Location": "Tibuktu",
"Organizational_Unit": null,
"Date_of_Birth": "19560719",
"Gender": "1"
},
{
"Mail": "mary@example.com",
"Name": "Smith",
"Employee_Number": "000777",
"First_Name": "Mary",
"Company": "ACME",
"Department": null,
"Employment_Status": "Retiree",
"Start_Date": "19770516",
"Function_Start_Date": "19770516",
"Group_Phone": "",
"Job_Title": "Manager",
"Sub_Group": "Exempts",
"Location": "Tibuktu",
"Organizational_Unit": null,
"Date_of_Birth": "19560719",
"Gender": "2"
}
]
Run Code Online (Sandbox Code Playgroud)
是否可以substr(.Start_Date,1,5)"-"substr(.Start_Date,6,2)"-"substr(.Start_Date,8,3) …
我很惊讶.我忘了包括strtotime但是意识到它在任何情况下都有效.为什么这样做?
if($_POST['active_to'] == '' || $_POST['active_to'] >= '2038-01-19'){
$postproduct->active_to = '2025-07-31';
}else{
$postproduct->active_to = $_POST['active_to'];
}
Run Code Online (Sandbox Code Playgroud)