How to check the time of docker container

Release: 2020-03-30 13:50:20
Original
17363 people have browsed it

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template