Senin, 07 November 2011

Dates and Times in MySQL, Part 2: Methods and Tips




DatabaseProNews (Enable images to fully enjoy)
November 07, 2011
Dates and Times in MySQL, Part 2: Methods and Tips
By Qushawn Clark
The previous article on the subject gave you a nice introduction to MySQL date types, but here I'm going to go more into entering dates and a few other important points. MySQL has a long list of functions associated with Date and Time fields, and they can be difficult to understand what they do, simply because so many of them do the same thing! Here are descriptions of a few of the more important ones:

NOW( ) – the now function returns the current date and time in the same format as a timestamp. CURRENT_TIMESTAMP( ) is a functional synonym for the now function, along with LOCALTIME( ) and LOCAL_TIMESTAMP( ), and they can be interchanged freely (although I always prefer consistency).

CUDATE( ) and CURTIME( ) return the current date and current time, respectively. It is important to understand that these are different from the previously mentioned set of functions. Various other functions such as WEEK( ), WEEKDAY( ), and YEARWEEK( ) return the parts of the given date. There are also a few functions for date arithmetic such as DATE_ADD( ) and DATE_SUB( ) that can be really useful.

Continue Reading
Performance Monitoring Software for Websites, Servers and Infrastructure
Download your FREE 14-day evaluation of WebWatchBot and begin experiencing the benefits of reliable monitoring today.


Today's Top Videos:
NBA Star Rick Fox: Online Media Is the Future
Rick Fox, who is known for his NBA, acting, and producing career, spoke to WebProNews about his passion for online media. According to him, "we are all received online." Even when Hollywood...
Learning New Languages, and Blogging About It.
Benny Lewis has quite the interesting concept, every 2 or 3 months he moves to a new country and learns a new language. He blogs about his travels, and funds all of this by selling one digital product.
Dispelling Myths of Social Media Marketing
Social media marketing is all about engaing with with your customers, joining the conversation, and being human as a brand. But, when you add the word marketing to the phrase social media...
Recent Articles:
SQL tips #1
With all of the talk about NoSQL going around, it is clear that people want better ways of storing large amounts of data in their databases. However, before you go running off to implement one of these new systems, don't forget that SQL has a few tricks of its own. Specifically, I am speaking of the BLOB (binary large object) data type, which allows you to store a variety of data within a single column, and the TEXT data type, which allows for extremely large pieces of character data to be stored. While it is clear that you can just store a single...
Read More...

Dates and Times in MySQL, Part 1...
Storing dates and times in MySQL may appear to be as complicated as dates in real life to those who have never delved into the subject. Programmers often default time using an int...
Read More...
Data Enrichment – Enhancing Online Data
We closed all X Change Registration at the beginning of last week – sold out and then some! Next Sunday I'll be heading down to San Diego and Monday things get started with Think Tank...
Read More...
Database Scalability, Part 5: The Process
So far we've looked at the three core areas involved in scaling databases and how to go about achieving greater scale in each are. In conclusion of this series on database scalability we...
Read More...
Other iEntry Business Resources:
- WebProNews.com
- Jayde.com
- MarketingNewz.com
- SalesNewz.com
- CareerNewz.com
- InvestNewz.com
- eCommNewz.com
- WebsiteNotes.com
- AdvertisingDay.com
iEntry
 
--This email is a service of DatabaseProNews--
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2011 iEntry, Inc. All Rights Reserved Privacy Policy Legal
DatabaseProNews: Deactivate / For other inquiries: support@ientry.com

0 komentar:

Posting Komentar

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More