PHP代碼:如何時間選擇器存儲到數據庫[關閉]
$odr_time = (isset($_POST['order_time'])) ? $_POST['order_time'] : "";
$Q_insert = "INSERT INTO dsp_order_item SET order_time = '".$ord_time."';
安卓
etTime.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v)
{
final Calendar c = Calendar.getInstance();
mHour = c.get(Calendar.HOUR_OF_DAY);
mMinute = c.get(Calendar.MINUTE);
// Launch Time Picker Dialog
TimePickerDialog timePickerDialog = new TimePickerDialog(getContext(),
new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay,
int minute) {
etTime.setText(String.format("%02d:%02d", hourOfDay, minute));
String order_time = etTime.getText().toString();
}
}, mHour, mMinute, false);
timePickerDialog.show();
}
});
此前,DATE [解決]和時間內成爲空當字段不具有任何價值。是否因爲我設置了數據類型「VARCHAR」,因此它不存儲它?
有什麼建議嗎?
當你運行你的應用程序時會發生什麼? –
@代碼學徒平滑〜 – user6868737
使用日期時間字段在分貝爲存儲從JSON –