Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
0
1
00:00:07,168 --> 00:00:08,192
Hi everyone
1
2
00:00:08,960 --> 00:00:13,568
In this section we will learn about some important date and time related functions
2
3
00:00:14,336 --> 00:00:19,456
Majorly there are two types of important functions one is where you will be finding out the
3
4
00:00:19,712 --> 00:00:20,992
Current date
4
5
00:00:21,248 --> 00:00:22,016
or time
5
6
00:00:22,528 --> 00:00:28,672
And the second type of function is where you are finding out the difference between two dates or difference between two times
6
7
00:00:28,928 --> 00:00:30,208
or you are taking out
7
8
00:00:30,464 --> 00:00:35,840
A particular part of that date or time, that is you are finding out the
8
9
00:00:36,608 --> 00:00:39,424
Month or the year only or the
9
10
00:00:39,680 --> 00:00:41,216
Minutes only from the time
10
11
00:00:41,984 --> 00:00:45,568
So segregating that individual parts from the whole datetime
11
12
00:00:46,336 --> 00:00:47,872
is something useful
12
13
00:00:48,384 --> 00:00:49,152
So let us start
13
14
00:00:49,408 --> 00:00:51,712
With finding out the current date and time
14
15
00:00:52,480 --> 00:00:55,552
For that we have three functions one is current date
15
16
00:00:56,320 --> 00:00:57,600
Second is current time
16
17
00:00:57,856 --> 00:00:59,136
third is current timestamp
17
18
00:00:59,648 --> 00:01:02,720
Current date will give you only date in the
18
19
00:01:02,976 --> 00:01:05,536
YYYY MM DD format
19
20
00:01:05,792 --> 00:01:10,144
This is the same format in which we inserted our data into our tables
20
21
00:01:11,168 --> 00:01:11,680
So
21
22
00:01:12,192 --> 00:01:14,752
It will give you current date in this format
22
23
00:01:16,032 --> 00:01:17,312
Then is current time
23
24
00:01:17,824 --> 00:01:19,616
It will give you the local time
24
25
00:01:20,128 --> 00:01:21,920
In hour minutes and seconds
25
26
00:01:22,688 --> 00:01:27,040
After decimal point you will get further fractions of the seconds also
26
27
00:01:27,808 --> 00:01:29,600
After that it'll mention the
27
28
00:01:30,368 --> 00:01:31,136
Time zone
28
29
00:01:31,904 --> 00:01:33,440
From the GMT
29
30
00:01:33,696 --> 00:01:35,488
From the Greenwich Meridian time zone
30
31
00:01:36,000 --> 00:01:39,584
So if you are in India it will be five and half hours Plus
31
32
00:01:40,864 --> 00:01:43,424
third is the current timestamp which includes both
32
33
00:01:43,936 --> 00:01:45,216
Date and time
33
34
00:01:45,728 --> 00:01:46,752
With the timezone
34
35
00:01:49,824 --> 00:01:54,944
So as an example we will be running select current date select current time select current timestamp
35
36
00:01:55,968 --> 00:01:57,248
Where this will be useful
36
37
00:01:58,016 --> 00:01:59,808
Suppose you have an order table
37
38
00:02:00,320 --> 00:02:00,832
In which
38
39
00:02:01,088 --> 00:02:02,112
Everyday you get
39
40
00:02:02,368 --> 00:02:08,512
New orders. whenever you are inserting the details of that order into your table, in one of the columns
40
41
00:02:08,768 --> 00:02:12,096
You can store the current date also so that
41
42
00:02:12,864 --> 00:02:14,400
Each order has the
42
43
00:02:14,656 --> 00:02:15,936
Order date stored in it
43
44
00:02:16,704 --> 00:02:21,312
Another way of using current date is if you want to find out age of a person so if you have
44
45
00:02:21,568 --> 00:02:22,848
Birthdate of a person
45
46
00:02:23,360 --> 00:02:24,384
You'll like to
46
47
00:02:24,640 --> 00:02:27,712
Find the difference between the current date and the birth date
47
48
00:02:27,968 --> 00:02:32,832
We'll see how to do that but you'll need current date also in that case
48
49
00:02:34,368 --> 00:02:35,904
So let us go and write these statement
49
50
00:02:36,160 --> 00:02:37,952
To see the current date and current time
50
51
00:02:42,560 --> 00:02:43,840
So select
51
52
00:02:44,352 --> 00:02:47,168
Current date,
52
53
00:02:48,192 --> 00:02:50,752
Current time,
53
54
00:02:55,104 --> 00:02:58,688
Current time bracket one
54
55
00:02:58,944 --> 00:03:05,088
So this parameter is the Precision parameter. you will see the difference between these
55
56
00:03:05,344 --> 00:03:05,856
Current time
56
57
00:03:06,112 --> 00:03:11,744
So that you will understand what this parameter signifies and last is current timestamp
57
58
00:03:13,536 --> 00:03:19,680
Current timestamp
58
59
00:03:20,448 --> 00:03:23,264
That's it. Let us run this.
59
60
00:03:24,544 --> 00:03:27,360
So you can see current date is
60
61
00:03:27,616 --> 00:03:31,200
27th December 2018
61
62
00:03:32,224 --> 00:03:33,504
The current time
62
63
00:03:34,016 --> 00:03:34,528
Is
63
64
00:03:35,296 --> 00:03:41,440
65
2:26:27 seconds and after that there are several fractions of that
64
66
00:03:41,696 --> 00:03:42,464
Second also
65
67
00:03:42,976 --> 00:03:45,536
And after that is mentioned the time zone
66
68
00:03:46,048 --> 00:03:47,072
From GMT
67
69
00:03:48,352 --> 00:03:49,376
Next
68
70
00:03:49,632 --> 00:03:53,472
If you see the current time with Precision parameter set at 1
69
71
00:03:53,984 --> 00:03:54,752
you'll see
70
72
00:03:55,008 --> 00:03:57,824
The fraction of second is given at
71
73
00:03:58,336 --> 00:04:00,128
1 decimal point only
72
74
00:04:00,384 --> 00:04:02,688
That is what we specified. one means
73
75
00:04:02,944 --> 00:04:05,504
After the decimal we need only one character
74
76
00:04:05,760 --> 00:04:07,808
All the other characters will be zero
75
77
00:04:10,368 --> 00:04:16,000
If you mention three you'll get three characters all the other characters will become zero
76
78
00:04:18,047 --> 00:04:20,607
Last is the timestamp where you can see
77
79
00:04:21,119 --> 00:04:22,143
Both the date
78
80
00:04:22,399 --> 00:04:23,679
And the time
79
81
00:04:24,703 --> 00:04:25,727
And you can see
80
82
00:04:25,983 --> 00:04:27,519
Set the date and time
81
83
00:04:28,031 --> 00:04:30,335
Is same as in the timestamp
6418
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.