Home >Operation and Maintenance >Docker >How to check the time of docker container

How to check the time of docker container

尚
Original
2020-03-30 13:50:2017411browse

How to check the time of docker container

How to check the docker container time:

Enter the container and execute the date command to check the time of the current container:

How to check the time of docker container

The date command can display the date in the specified format. Just type date to display the current time in the default format.

Method to modify the container time:

Re-enter the container as follows:

docker run -it --cap-add SYS_TIME --rm --name centos centos / bin/bash

After entering the container, use the following command to modify the container time:

date -s 08/24/2006
date -s 13:02:00

For more related tutorials, please pay attention to the docker tutorial column on the PHP Chinese website.

The above is the detailed content of How to check the time of docker container. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn