mysql date time string format for marshmellow field schema 1

mysql date time string format for marshmellow field schema

datetime.datetime.strftime("%Y-%m-%dT%H:%M:%S")

Here is what the above code is Doing:
1. We’re importing the datetime module.
2. We’re creating a variable called now and setting it equal to datetime.datetime.now().
3. We’re creating a variable called current_time and setting it equal to now.strftime(“%H:%M:%S”).
4. We’re creating a variable called current_date and setting it equal to now.strftime(“%Y-%m-%d”).
5. We’re creating a variable called current_datetime and setting it equal to now.strftime(“%Y-%m-%dT%H:%M:%S”).

Similar Posts