Got it to work by formatting the $dateAndTime string like this before binding it:
$formattedDateAndTime = date("Y-m-d H:i:s", strtotime($dateAndTime));
Related Posts:
- How to add 2 hours to the wordpress time formed with current_time(“mysql”, false)?
- How do I join a $wpdb query with user meta using default value if not exist?
- Copyright: Get first and last date of post type
- How to convert a string to date in MySQL?
- MySQL date formats – difficulty Inserting a date
- How to use greater than operator with date?
- How do you properly prepare a %LIKE% SQL statement?
- $wpdb and MySQL Create Trigger
- wpdb->prepare function remove single quote for %s in SQL statment
- Alternative to mysql_real_escape_string
- Increment value (value = value+1) of $wpdb->update
- SQL query to update post_date (one post = one single date & time)
- wpdb Custom Meta Data with 2 conditions
- wpdb prepare syntax
- SQL query not working in alphabetical post title/content search
- MySQL LIKE not working
- Proper way to work with wpdb to get user’s firstname
- How to check for empty and not a failure
- Is a MySQL DATETIME or TIMESTAMP value retrieved through $wpdb in UTC?
- Database: Custom table: sprintf value for DateTime column
- Converting mysql to $wpdb
- WP_USE_EXT_MYSQL
- wpdb insert and boolean fields
- Join new table with SQL query
- writing inner join in wpdb
- How to split the a table in database?
- MySQL Rank & $wpdb
- When WordPress Default table, Echo Success. When Plugin Table, Echo Blank
- How to translate this mySQL query to $wpdb query
- $wpdb select all meta for each post
- $wpdb to insert html form information
- Proper usage of $wpdb->update()?
- WordPress(wpdb class) and mysql stored procedures
- Can’t run database query
- Using WPDB->Insert()
- Active DB queries in WordPress?
- How to stop $wpdb from prepending database name
- WordPress $wpdb get posts from category and sort by custom meta
- How to get INSERT errors from $wpdb?
- Getting Error Trying to Create Table
- How to set MYSQLI_OPT_INT_AND_FLOAT_NATIVE option
- Understanding custom php that reads from WP MYSQL
- How to insert dash (-) into database using wpdb and new_to_publish hook?
- $wpdb->get_var multiple queries in one database check
- List users with the most posts in the last 30 days
- Insert two row in wordpress database
- WordPress $wpdb no result
- PHP variables in mysql query
- MySQL ‘duplicate entry’ error
- Wpdb query with dynamic table name
- get posts whether meta_key exists or not
- when using $wpdb sudden connection rejection without changing anything. Access denied, with errors from repair tool
- How to search usermeta table
- How to add virtual column in wpdb get_result statement
- wpdb insert into point column in db
- WPDB delivers wrong results from complex queries
- $wpdb post type and term query only works when there are no dashes or spaces in the term slug and title
- CONCAT_WS in custom sql query
- Geographical proximity query using post_meta
- MySQL Select within WP Page template
- Saving custom term value to the database in new table
- why is $wpdb->update() causing a DB error from within wp_set_password()
- $wpdb->get_var returns 0
- Initialization of table in database using ‘CREATE … IF NOT EXISTS’
- MySQL IF NOT NULL, then display 1, else display 0
- Get the new record primary key ID from MySQL insert query?
- ERROR 1115 (42000): Unknown character set: ‘utf8mb4’
- Error Code: 1290. The MySQL server is running with the –secure-file-priv option so it cannot execute this statement
- Remove Primary Key in MySQL
- How to get the max of two values in MySQL?
- Error: Duplicate entry ‘0’ for key ‘PRIMARY’
- Why are simple updates to wp_postmeta’s “_edit_lock” so slow?
- Get date of last update outside of loop
- query to create woocommerce products from images
- Date query not inclusive despite parameter being true
- wp query foreach deleting record returning only first or last item
- mySQL statment count of post in each category and sub category
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- Paypal Post IPN handeling nightmare
- Is there a page length limit?
- Create a form with custom autocomplete address field and CSV import values
- WordPress insert query is not working : Showing no Error
- Some Post Content Does Not Show Up In DB Search
- Help setting up a sql query
- How can I view my site directly from WordPress dashboard?
- (WP List Table) How to sort by SKU and Custom Fields?
- Using wpdb to connect to a different database is not working
- Why can’t i come back to older working version of php after ugrade with error log on php 7.2 and 7.3
- Can’t add to time? [closed]
- Timezone for Plugin
- How do I insert content of various MySQL fields in post?
- Query does not filter duplicate _sku numbers
- wp_postmeta – lot of meta fields
- MySQL: get post_tag items that are tags (not SEO keywords)
- cannot log in to the mysql server (wamp and wordpress)
- InnoDB: Error: log file ./ib_logfile0 is of different size
- Postgres equivalent to MySQL’s \G?
- Convert custom field date format to “WordPress default”
- Putting form result in my database
- How can I update a value of a field depending on outside source?