• Image 1
  • Image 2
  • Image 3
  • Image 4
  • Image 5
  • Image 6
  • Image 7




Sunday, September 16, 2012

DATE AND TIME FUNCTIONS IN MYSQL


Hi.. friends welcome to my site.. in here you will getting many IT knowledge. From program language based dekstop programming until program language based web programming here.. You will take FREE..

Previously I was discuss about “function in MYSQL”, and now I want giving you about “date and time functions in MYSQL”. You will know ?? let’s do read this article. Have fun and enjoy reading my article…


1. Date and Time Functions In MYSQL

In MYSQL programming languages ​​are also no settings to set the date and time .. This arrangement was made to allow a user to use this programming language. For this function, similar in function to other databases, such as Oracle .. And this is the date and time functions in MYSQL.


A. NOW or SYSDATE

>> This function produces the date and time right now, so if you want to enter the current time you can use this function


B. MOUNT

>> If you want to enter in a numerical form, you can use this. Because of this result for the month in numerical form


C. WEEK

>> This function is to get how many weeks in a year 'n'


D. YEAR

>> Function to get the value of the year, you can use the 'SYSDATE' with this function


E. HOUR, MINUTE, and SECOND

>> For Hour, to get the clock in the form of numerical values
>> For Minute, to get the minutes in the form of numerical values
>> For second, to get the second value in the form of numerical


You can use this format to display the date :

DATE_FORMAT(date, format)


You can use this format to display the time :

TIME_FORMAT(time, format)


At the date and time functions, we can show them the way we want, such as: only the year or only the date and the month alone. We also can change it from "DD-MM-YYYY" to "MM-DD-YYYY" .. And this is the form of zoom :


%M >> name of moon
%W >> name of day
%D  >> order of the day
%Y  >> show 4 (four) digit years
%y   >> show 2 (two) digit years
%a   >> name of day
%H >> show time
%i    >> show minutes
%s   >> show seconds



Ok.. just it..
I hope you can using it…
See you later…

No comments:

Post a Comment