Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
0 Hi everyone 1
In this section we will learn about some important date and time related functions 2
Majorly there are two types of important functions one is where you will be finding out the 3
Current date 4
or time 5
And the second type of function is where you are finding out the difference between two dates or difference between two times 6
or you are taking out 7
A particular part of that date or time, that is you are finding out the 8
Month or the year only or the 9
Minutes only from the time 10
So segregating that individual parts from the whole datetime 11
is something useful 12
So let us start 13
With finding out the current date and time 14
For that we have three functions one is current date 15
Second is current time 16
third is current timestamp 17
Current date will give you only date in the 18
YYYY MM DD format 19
This is the same format in which we inserted our data into our tables 20
So 21
It will give you current date in this format 22
Then is current time 23
It will give you the local time 24
In hour minutes and seconds 25
After decimal point you will get further fractions of the seconds also 26
After that it'll mention the 27
Time zone 28
From the GMT 29
From the Greenwich Meridian time zone 30
So if you are in India it will be five and half hours Plus 31
third is the current timestamp which includes both 32
Date and time 33
With the timezone 34
So as an example we will be running select current date select current time select current timestamp 35
Where this will be useful 36
Suppose you have an order table 37
In which 38
Everyday you get 39
New orders. whenever you are inserting the details of that order into your table, in one of the columns 40
You can store the current date also so that 41
Each order has the 42
Order date stored in it 43
Another way of using current date is if you want to find out age of a person so if you have 44
Birthdate of a person 45
You'll like to 46
Find the difference between the current date and the birth date 47
We'll see how to do that but you'll need current date also in that case 48
So let us go and write these statement 49
To see the current date and current time 50
So select 51
Current date, 52
Current time, 53
Current time bracket one 54
So this parameter is the Precision parameter. you will see the difference between these 55
Current time 56
So that you will understand what this parameter signifies and last is current timestamp 57
Current timestamp 58
That's it. Let us run this. 59
So you can see current date is 60
27th December 2018 61
The current time 62
Is 63
65 2:26:27 seconds and after that there are several fractions of that 64
Second also 65
And after that is mentioned the time zone 66
From GMT 67
Next 68
If you see the current time with Precision parameter set at 1 69
you'll see 70
The fraction of second is given at 71
1 decimal point only 72
That is what we specified. one means 73
After the decimal we need only one character 74
All the other characters will be zero 75
If you mention three you'll get three characters all the other characters will become zero 76
Last is the timestamp where you can see 77
Both the date 78
And the time 79
And you can see 80
Set the date and time 81
Is same as in the timestamp
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.