I am using Asp.Net and want to convert datetime into integer format. I am getting this date from SQL.

```
> I want 2021/03/15 date into 1210315 in my application and will use it further.
> 
> Here, 1 is century, 21 is year, 03 is month, and 15 is date.

```

I have googled a lot but couldn't find any solution.
If anyone have any idea, then give its solution and your help would be appreciated.....Thanks

I am briefly describing my problem:

Here is my stored procedure

```
create proc spMaxDate
As
Begin
select max(Date) from Customer
End

```

Then in my application I have fetched the max date from this stored procedure as:

```
var SQlDate = db.spMaxDate().FirstOrDefault();

```

Here, I am getting date as 2021/03/15.
So, I have to convert it in 1210315 format as described earlier....Or If its possible to convert it in SQL select statement then you can tell.