I am trying to save the current date time format from C# and convert it to an SQL Server date format like so yyyy-MM-dd HH:mm:ss
so I can use it for my UP
Another solution to pass DateTime from C# to SQL Server, irrespective of SQL Server language settings
supposedly that your Regional Settings show date as dd.MM.yyyy (German standard '104') then
DateTime myDateTime = DateTime.Now;
string sqlServerDate = "CONVERT(date,'"+myDateTime+"',104)";
passes the C# datetime variable to SQL Server Date type variable, considering the mapping as per "104" rules . Sql Server date gets yyyy-MM-dd
If your Regional Settings display DateTime differently, then use the appropriate matching from the SQL Server CONVERT Table
see more about Rules: https://www.techonthenet.com/sql_server/functions/convert.php