当前位置:网站首页>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 边栏推荐
- How NPM switches Taobao source images
- The framing efficiency of setpreviewcallbackwithbuffer will become lower
- SSM-使用@Async和创建ThreadPoolTaskExecutor线程池
- System integration under microservice architecture
- Go concurrent programming basics
- Why does Baidu search only crawl, but not show the page?
- Uncaught Error:Invalid geoJson format Cannot read property ‘length‘ of undefind
- Ctfshow network lost track record (1)
- Using El date picker to report errors in sub components
- quii cordova-plugin-telerik-imagepicker插件多图上传乱序
猜你喜欢

ctfshow 做题 web模块 web11~web14

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

Young freshmen yearn for more open source | here comes the escape guide from open source to employment!

八、QOS队列调度与报文丢弃

How to measure software architecture

Moco V1: the visual field can also be self supervised

上市1个月接连发生两起安全事故,理想L9还理想吗?

Sharkteam completes the safety audit of flow ecological NFT market matrixmarket

What functions does MySQL have? Don't look everywhere. Just look at this.

Two excellent software of my love cracking, batch search text, image and video image quality enhancement
随机推荐
Jiuxin intelligence officially joined opengauss community
多线程顺序运行的 4 种方法,面试随便问
Link with Bracket Sequence I(状态基多维dp)
Another installation artifact
华为发布首款电驱动系统DriveONE:充电10分钟续航200km
How to build a foreign environment for the self-supporting number of express evaluation? How much does it cost?
如何度量软件架构
向往的开源之多YOUNG新生 | 从开源到就业的避坑指南来啦!
quii cordova-plugin-telerik-imagepicker插件多图上传乱序
Applet container technology improves mobile R & D efficiency by 500%
How Oracle exports data (how Oracle backs up databases)
ABB electromagnetic flowmeter maintenance signal transmitter maintenance 41f/e4 technical parameters
CVPR 2022 | in depth study of batch normalized estimation offset in network
Redis缓存雪崩、缓存穿透、缓存击穿
SSM use @async and create threadpooltaskexecutor thread pool
Bus, protocol, specification, interface, data acquisition and control system in industrial communication field
The greatest romance of programmers~
顶级“Redis 笔记”, 缓存雪崩 + 击穿 + 穿透 + 集群 + 分布式锁,NB 了
1162. Map analysis - non recursive method
Young freshmen yearn for more open source | here comes the escape guide from open source to employment!