What does a single quote inside a C# date time format mean?

It’s a literal string delimiter.

Anything between the single quotes is interpreted as a literal character, and will not be interpreted as a custom format string.

They are equivalent to escaping using a backslash: dd'T'HH is the same as dd\THH.

In your string yyyy'-'MM'-'dd'T'HH':'mm':'ss, the quotes are unnecessary around the - and T, as those are not custom format strings, and so will always be interpreted as string literals. However : is a format specifier, which evaluates to a time separator that’s suitable for the current culture. Quoting it as ':' means that the literal character : will always be used, regardless of the current culture.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)