Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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
STAFF
Ken Alger
Treehouse Teacher

Rifqi;

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.
Ken