当前位置:网站首页>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 边栏推荐
- SQL server中提示对象名无效
- Icml2022 | timing self-monitoring video transformer
- (PMIC)全、半桥驱动器CSD95481RWJ PDF 规格
- (PMIC) full and half bridge drive csd95481rwj PDF specification
- Learning typescript (II)
- 编码用这16个命名规则能让你少写一半以上的注释!
- 高举5G和AI两面旗帜:紫光展锐市场峰会火爆申城
- Study - Summary of geometric calculations
- [input ID number] is replaced by an asterisk, and input is cut into multiple small squares (similar)
- What is low code? Which platforms are suitable for business personnel? Is it reliable to develop the system?
猜你喜欢

实现瀑布流效果

Mobilevit: challenge the end-to-side overlord of mobilenet

Uncaught Error:Invalid geoJson format Cannot read property ‘length‘ of undefind

(turn) bubble sorting and optimization details

一名在读研究生的自白:我为什么会沉迷于openGauss 社区?

SSM use @async and create threadpooltaskexecutor thread pool

Kubeadm搭建kubernetes集群

BUUCTF做题Upload-Labs记录pass-11~pass-20

探讨:想要落地DevOps的话,只考虑好的PaaS容器平台就够了么?

High salary in the workplace | "intermediate and advanced test" interview questions
随机推荐
Analysis of critical path
ICML2022 | 时序自监督视频transformer
How to build a foreign environment for the self-supporting number of express evaluation? How much does it cost?
提前布局6G赛道!紫光展锐发布《6G无界 有AI》白皮书
华为发布首款电驱动系统DriveONE:充电10分钟续航200km
基于Xilinx的时序分析与约束
Another installation artifact
九鑫智能正式加入openGauss社区
Redis缓存雪崩、缓存穿透、缓存击穿
[cloud native] what is ci/cd| Ci/cd to smooth delivery obstacles
怎么理解数据网格(Data Mesh)
30.学习Highcharts 标签旋转柱形图
SkiaSharp 之 WPF 自绘 拖曳小球(案例版)
到底为什么不建议使用SELECT * ?
ctfshow 做题 web模块 web11~web14
Kubedm builds kubernetes cluster
Confession of a graduate student: why am I addicted to opengauss community?
如何度量软件架构
酷派主动终止针对小米公司的专利侵权诉讼
[Zhou Zhou has a prize] cloud native programming challenge "edge container" track invites you to fight!