There are multiple ways to get the current time. You can set the right time zone then get the system current time.
You can follow the ways to set the time zone in the docker container or Dockerfile here. Also, you can set the time zone in Azure Web App while you deploy your application in it. Azure Web App uses the environment variable WEBSITE_TIME_ZONE
to set the time zone. For more details, see AppService: Setting a time-zone with a WEBSITE_TIME_ZONE App Setting (and many more).
But I would suggest you just get the current UTC time and then calculate your time with the right time zone in your code. This is the best way to get the time as I think.
Update
As I think, what you need is to configure the SSH server in the custom image and then when you deploy the image to Azure Web App, you can ssh into the container to debug. So, you could follow the steps in SSH support for Azure App Service on Linux to configure the SSH server.
You can also set the date when you create the image from Dockerfile. Here is an example.