All right so let's go ahead and add our time.
So still an hour of these stack.
They're going to add in a text.
And this one's going to say time and inside.
Let's go ahead and do some interpolation here.
I'm just gonna go ahead and pass our data that properties and I'm going to go ahead and get time.
OK.
Says it's a dabble there and we're gonna have some issues for obvious reasons so let's save this and
run
right so you can see here the time is not very helpful because it's just showing this huge number for
time which is not necessarily what we want.
The reason why this is happening is because the timestamp that we have in our payload here is probably
UNIX timestamp which is more or less the computer time.
And so we need to convert it into something that will actually make sense for users.
So to do that we'll have to create a function that will convert the time.
Now I already have the function that's needed here and I'm just going to copy and paste here.
So I don't have to waste time typing it all for you.
I'm going to put that inside of our content view right there.
So I've got some information here as well and I'll go through that.
So what's happening here all this time converter here.
Are we accepting a timestamp of type double.
And we're returning a string because we want to return the time in the string format so we can see it.
So what happens here.
We take the timestamp that we get.
So any number that we get such as this and we divide by thousand.
So we can actually get milliseconds that's one thing that I had learned the hard way because I thought
I just could take the timestamp and do all these calculations and then get the time if you do that you
will get a slightly wrong time.
The reason why we're doing this is because we need to pass this timestamp that we are dividing by a
thousand.
Into the date class as you can see here.
Right.
We take this time stamp and we pass into data class here and then we use for matters to actually format
our timing to something that we can see.
So this is where all of this comes to play.
So if we pass certain regular expressions where say through our date for matter as you can see here
we're saying we want a date format to be this form.
This means we are going to have day month year our minute and second.
OK.
So that's what we are doing.
So essentially we're just converting everything into something that users can actually see or something
users can recognize as a date and then we return that using our date format or object that we created.
That's all.
So now I can actually use that in my if you go to our cell like this I can wrap all of that because
remember our time converter requires the time stamp which is all of this.
So what I'm gonna do here I'm just going to say time converter like this.
Put a time stamp like that which is going to be all of that and let's go ahead and close this down.
So we actually have everything that we need.
There we go.
So we're taking our time that we're getting from our Jason API and we passing through our time converters
at this point here which should hopefully see in more readable time.
And while I just like that you can see this is October 2nd 2019.
This is when it happened.
Right.
All of that said this is actually working because today is October 2nd.
Now these will always change obviously depending on the time that we're receiving from our payload for
obvious reasons right.
So let's go ahead and add a few modifiers here.
I want to make this time italic and foreground color is gonna be orange.
And let's give it a font to be a sub headline like this.
And for now I'm gonna give it a padding top padding that is of about 2 so that there is some space between
the place and the time just a little bit there.
OK very good.
Look at this our app is looking much much better.