Databases Reporting with SQL Date and Time Functions Creating Up-to-the-Minute Reports

Rifqi Fahmi
Rifqi Fahmi
23,164 Points

How does this DATE() function work ?

I know the DATE() function in sql show the current date. but how does it actually work ? i mean in what aspect it show the current date in user end, is it based on client's IP, Timezone, or other.

Why I am asking this question ? something is bothering in my mind, what if the user lived in different country at different timezone, there must be a gap of time between the country. Because of it, it affect the accuracy of the current date on client end although the difference is not to big but still i want to get precise data for my client.

Thanks :)

1 Answer

Ken Alger
Ken Alger
Treehouse Teacher


Generally speaking the date() function will report the date of the location of the server at the time that it is called. Handling localization is generally part of the application design process and should be done early on in the process.

Post back with further questions.