79664141

Date: 2025-06-12 22:00:53
Score: 0.5
Natty:
Report link

You can follow what @yoduh suggested, and here is how you can send it to backend

const deliveryTime = ref(new Date());
const payload = reactive({
  DeliveryTime: deliveryTime.value,
});

watch(deliveryTime, (time) => {
  if (!time) return;

  const now = new Date();
  now.setUTCHours(time.hours);
  now.setUTCMinutes(time.minutes);
  now.setUTCSeconds(time.seconds || 0);

  payload.DeliveryTime = now.toISOString(); // "2025-06-12T00:49:00.485Z"

  // Optionally, format for MySQL datetime without timezone:
  payload.DeliveryTime = now.toISOString().slice(0, 19).replace('T', ' '); // "2025-06-12 00:46:00"
});
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @yoduh
  • Low reputation (0.5):
Posted by: Ebraheem Al-hetari