当前位置:网站首页>NTP server time (view server time)
NTP server time (view server time)
2022-07-28 21:29:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
public static String getNTPServerDateTime(String NTPTimeServerUrl) {
String dateTimeMessage;
try {
NTPUDPClient timeClient = new NTPUDPClient();
InetAddress timeServerAddress = InetAddress.getByName(NTPTimeServerUrl);
TimeInfo timeInfo = timeClient.getTime(timeServerAddress);
TimeStamp timeStamp = timeInfo.getMessage().getTransmitTimeStamp();
Date date = timeStamp.getDate();
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
dateTimeMessage = dateFormat.format(date);
} catch (UnknownHostException e) {
return e.getMessage();
} catch (IOException e) {
return e.getMessage();
}
return dateTimeMessage;
}NTPTimeServerUrl by NTP Server address , For example, Shanghai Jiaotong University Network Center NTP The server address is :202.120.2.101 边栏推荐
- Pytorch学习记录(三):随机梯度下降、神经网络与全连接
- Reading and writing basic data types in protobuf
- Top level "redis notes", cache avalanche + breakdown + penetration + cluster + distributed lock, Nb
- 实现瀑布流效果
- Timing analysis and constraints based on Xilinx
- Kubedm builds kubernetes cluster
- Baidu search is in line with expectations, but it involves the black hat strategy of the external chain. What is the reason?
- uniapp的进度条自定义
- Introduction to blue team: efficiency tools
- DELTA热金属检测器维修V5G-JC-R1激光测量传感器/检测仪原理分析
猜你喜欢

Kubeadm搭建kubernetes集群

Ctfshow network lost track record (2)

Two excellent software of my love cracking, batch search text, image and video image quality enhancement

Coding with these 16 naming rules can save you more than half of your comments!

How to measure software architecture

Pytorch学习记录(三):随机梯度下降、神经网络与全连接

云安全核心技术

The ref value ‘xxx‘ will likely have changed by the time this effect function runs. If this ref......

ICML2022 | 时序自监督视频transformer

(PMIC)全、半桥驱动器CSD95481RWJ PDF 规格
随机推荐
Maxwell 一款简单易上手的实时抓取Mysql数据的软件
Baidu search is in line with expectations, but it involves the black hat strategy of the external chain. What is the reason?
ABB电磁流量计维修信号变送器维修41F/E4技术参数
[cloud native] what is ci/cd| Ci/cd to smooth delivery obstacles
Why on earth is it not recommended to use select *?
The development of smart home industry pays close attention to edge computing and applet container technology
SSM use @async and create threadpooltaskexecutor thread pool
八、QOS队列调度与报文丢弃
The ref value ‘xxx‘ will likely have changed by the time this effect function runs.If this ref......
Redis cache avalanche, cache penetration, cache breakdown
4.2 Virtual Member Functions
C process control statement
Several skills of API interface optimization
What is low code? Which platforms are suitable for business personnel? Is it reliable to develop the system?
Buuctf questions upload labs record pass-01~pass-10
Top level "redis notes", cache avalanche + breakdown + penetration + cluster + distributed lock, Nb
ctfshow 做题 web模块 web11~web14
ICML2022 | 时序自监督视频transformer
30. Learn highcharts label rotation histogram
Icml2022 | timing self-monitoring video transformer