Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

In a typical web application, dates are retrieved from the database layer strongly typed (e.g. in c# as a System.DateTime as opposed System.String).

When a date needs to be expressed as a string (e.g. displayed on a page), the conversion from DateTime to string is done in the presentation tier.

Why is this? Why is it a bad thing to convert the DateTime to a string on the database tier?

See also the heated debate in chat, and the original question that started all of thisoriginal question that started all of this.

In a typical web application, dates are retrieved from the database layer strongly typed (e.g. in c# as a System.DateTime as opposed System.String).

When a date needs to be expressed as a string (e.g. displayed on a page), the conversion from DateTime to string is done in the presentation tier.

Why is this? Why is it a bad thing to convert the DateTime to a string on the database tier?

See also the heated debate in chat, and the original question that started all of this.

In a typical web application, dates are retrieved from the database layer strongly typed (e.g. in c# as a System.DateTime as opposed System.String).

When a date needs to be expressed as a string (e.g. displayed on a page), the conversion from DateTime to string is done in the presentation tier.

Why is this? Why is it a bad thing to convert the DateTime to a string on the database tier?

See also the heated debate in chat, and the original question that started all of this.

added 342 characters in body
Source Link
John Wu
  • 27k
  • 10
  • 69
  • 93

In a typical web application, dates are retrieved from the database layer strongly typed (e.g. in c# as a System.DateTime as opposed System.String).

When a date needs to be expressed as a string (e.g. displayed on a page), the conversion from DateTime to string is done in the presentation tier.

Why is this? Why is it a bad thing to convert the DateTime to a string on the database tier?

See also the heated debate in chat, and the original question that started all of this.

In a typical web application, dates are retrieved from the database layer strongly typed (e.g. in c# as a System.DateTime as opposed System.String).

When a date needs to be expressed as a string (e.g. displayed on a page), the conversion from DateTime to string is done in the presentation tier.

Why is this? Why is it a bad thing to convert the DateTime to a string on the database tier?

In a typical web application, dates are retrieved from the database layer strongly typed (e.g. in c# as a System.DateTime as opposed System.String).

When a date needs to be expressed as a string (e.g. displayed on a page), the conversion from DateTime to string is done in the presentation tier.

Why is this? Why is it a bad thing to convert the DateTime to a string on the database tier?

See also the heated debate in chat, and the original question that started all of this.

Tweeted twitter.com/StackProgrammer/status/778755124478873601
Source Link
John Wu
  • 27k
  • 10
  • 69
  • 93

Why not return dates as a string from the database?

In a typical web application, dates are retrieved from the database layer strongly typed (e.g. in c# as a System.DateTime as opposed System.String).

When a date needs to be expressed as a string (e.g. displayed on a page), the conversion from DateTime to string is done in the presentation tier.

Why is this? Why is it a bad thing to convert the DateTime to a string on the database tier?