1 00:00:00,540 --> 00:00:02,970 All right so let's go ahead and add our time. 2 00:00:03,030 --> 00:00:04,690 So still an hour of these stack. 3 00:00:04,700 --> 00:00:07,110 They're going to add in a text. 4 00:00:07,920 --> 00:00:11,790 And this one's going to say time and inside. 5 00:00:11,790 --> 00:00:13,800 Let's go ahead and do some interpolation here. 6 00:00:13,800 --> 00:00:20,440 I'm just gonna go ahead and pass our data that properties and I'm going to go ahead and get time. 7 00:00:20,690 --> 00:00:21,000 OK. 8 00:00:21,210 --> 00:00:26,340 Says it's a dabble there and we're gonna have some issues for obvious reasons so let's save this and 9 00:00:26,610 --> 00:00:27,120 run 10 00:00:30,090 --> 00:00:36,380 right so you can see here the time is not very helpful because it's just showing this huge number for 11 00:00:36,390 --> 00:00:39,360 time which is not necessarily what we want. 12 00:00:39,360 --> 00:00:45,510 The reason why this is happening is because the timestamp that we have in our payload here is probably 13 00:00:45,570 --> 00:00:49,870 UNIX timestamp which is more or less the computer time. 14 00:00:49,950 --> 00:00:55,050 And so we need to convert it into something that will actually make sense for users. 15 00:00:55,770 --> 00:01:00,450 So to do that we'll have to create a function that will convert the time. 16 00:01:00,450 --> 00:01:04,520 Now I already have the function that's needed here and I'm just going to copy and paste here. 17 00:01:04,530 --> 00:01:07,060 So I don't have to waste time typing it all for you. 18 00:01:07,110 --> 00:01:10,350 I'm going to put that inside of our content view right there. 19 00:01:10,380 --> 00:01:14,040 So I've got some information here as well and I'll go through that. 20 00:01:14,220 --> 00:01:16,630 So what's happening here all this time converter here. 21 00:01:16,630 --> 00:01:20,010 Are we accepting a timestamp of type double. 22 00:01:20,010 --> 00:01:24,860 And we're returning a string because we want to return the time in the string format so we can see it. 23 00:01:25,290 --> 00:01:26,340 So what happens here. 24 00:01:26,340 --> 00:01:28,230 We take the timestamp that we get. 25 00:01:28,230 --> 00:01:32,270 So any number that we get such as this and we divide by thousand. 26 00:01:32,280 --> 00:01:37,170 So we can actually get milliseconds that's one thing that I had learned the hard way because I thought 27 00:01:37,200 --> 00:01:42,660 I just could take the timestamp and do all these calculations and then get the time if you do that you 28 00:01:42,660 --> 00:01:45,480 will get a slightly wrong time. 29 00:01:45,480 --> 00:01:49,920 The reason why we're doing this is because we need to pass this timestamp that we are dividing by a 30 00:01:49,920 --> 00:01:51,340 thousand. 31 00:01:51,780 --> 00:01:54,720 Into the date class as you can see here. 32 00:01:54,860 --> 00:01:55,070 Right. 33 00:01:55,080 --> 00:02:01,350 We take this time stamp and we pass into data class here and then we use for matters to actually format 34 00:02:01,440 --> 00:02:03,150 our timing to something that we can see. 35 00:02:03,150 --> 00:02:06,150 So this is where all of this comes to play. 36 00:02:06,180 --> 00:02:12,480 So if we pass certain regular expressions where say through our date for matter as you can see here 37 00:02:12,690 --> 00:02:15,990 we're saying we want a date format to be this form. 38 00:02:15,990 --> 00:02:21,450 This means we are going to have day month year our minute and second. 39 00:02:22,250 --> 00:02:22,990 OK. 40 00:02:23,130 --> 00:02:24,780 So that's what we are doing. 41 00:02:24,780 --> 00:02:29,520 So essentially we're just converting everything into something that users can actually see or something 42 00:02:29,520 --> 00:02:35,040 users can recognize as a date and then we return that using our date format or object that we created. 43 00:02:35,400 --> 00:02:36,170 That's all. 44 00:02:36,180 --> 00:02:43,980 So now I can actually use that in my if you go to our cell like this I can wrap all of that because 45 00:02:43,980 --> 00:02:49,140 remember our time converter requires the time stamp which is all of this. 46 00:02:49,140 --> 00:02:54,990 So what I'm gonna do here I'm just going to say time converter like this. 47 00:02:55,290 --> 00:03:02,410 Put a time stamp like that which is going to be all of that and let's go ahead and close this down. 48 00:03:02,460 --> 00:03:05,130 So we actually have everything that we need. 49 00:03:05,130 --> 00:03:05,820 There we go. 50 00:03:05,820 --> 00:03:11,540 So we're taking our time that we're getting from our Jason API and we passing through our time converters 51 00:03:11,610 --> 00:03:16,990 at this point here which should hopefully see in more readable time. 52 00:03:17,130 --> 00:03:21,710 And while I just like that you can see this is October 2nd 2019. 53 00:03:21,720 --> 00:03:23,240 This is when it happened. 54 00:03:23,320 --> 00:03:23,850 Right. 55 00:03:23,850 --> 00:03:28,550 All of that said this is actually working because today is October 2nd. 56 00:03:28,590 --> 00:03:34,410 Now these will always change obviously depending on the time that we're receiving from our payload for 57 00:03:34,410 --> 00:03:36,650 obvious reasons right. 58 00:03:37,670 --> 00:03:40,410 So let's go ahead and add a few modifiers here. 59 00:03:40,410 --> 00:03:46,620 I want to make this time italic and foreground color is gonna be orange. 60 00:03:46,940 --> 00:03:52,950 And let's give it a font to be a sub headline like this. 61 00:03:52,950 --> 00:04:01,170 And for now I'm gonna give it a padding top padding that is of about 2 so that there is some space between 62 00:04:01,440 --> 00:04:04,900 the place and the time just a little bit there. 63 00:04:04,900 --> 00:04:07,080 OK very good. 64 00:04:07,080 --> 00:04:09,540 Look at this our app is looking much much better.