I am having trouble formatting my date and time so that it can be sent to a mysql database
the table has column
receiving_date as type Date
From MySQL Manual
A date. The supported range is '1000-01-01' to '9999-12-31'. MySQL displays DATE values in 'YYYY-MM-DD' format, but allows you to assign values to DATE columns using either strings or numbers.
receiving_time as type Time
A time. The range is '-838:59:59' to '838:59:59'. MySQL displays TIME values in 'HH:MM:SS' format, but allows you to assign values to TIME columns using either strings or numbers.
My function is this
Public Function getTime() As DateTime
Dim currentTime As DateTime
'get system time
currentTime = DateTime.Now
So now I need to format the date so I get YYYY-MM-DD and time to be HH:MM:SS
I was going to individually parse the date and format a new string into those two formats but I was hoping there was a better way of formatting it right in the function and returning the necessary info cuz I use this function in a couple places