I am using the Views Database Connector module in drupal 8 to display the data from an external mssql database. I am running into issues with the date field. When I am asked to configure this field in the view, I am asked to choose a format for the date. However, when I go to view the page, I get this error (and stacktrace):
InvalidArgumentException: The timestamp must be numeric. in DrupalComponentDatetimeDateTimePlus::createFromTimestamp() (line 172 of core/lib/Drupal/Component/Datetime/DateTimePlus.php).
DrupalCoreDatetimeDateFormatter->format(‘2009-03-02’, ‘html_year’, ”, ‘UTC’, ‘en’) (Line: 323)
format_date(‘2009-03-02’, ‘html_year’, ”, NULL) (Line: 177)
DrupalviewsPluginviewsfieldDate->render(Object) (Line: 1144) DrupalviewsPluginviewsfieldFieldPluginBase->advancedRender(Object) (Line: 224) template_preprocess_views_view_field(Array, ‘views_view_field’, Array) (Line: 287) DrupalCoreThemeThemeManager->render(‘views_view_field’, Array) (Line: 435) DrupalCoreRenderRenderer->doRender(Array, ) (Line: 195)
I have not been able to figure out how to get the date to be converted to a timestamp so it can be formatted. I have tried a preprocessor but the template_preprocess_view_view_field always occurs first and the exception occurs before it gets to my preprocess function. Is there something particular about the date data type in mssql? Any suggestions how to get the date to not generate the exception?
Sponsored by SupremePR