How to calculate date and time involving time zone? doesn’t have to be hard.

Calculating time with a zone was never this easy. Using the date-time API, you can calculate with timezone pretty much effortlessly.

Let’s assume we have a flight from Toronto (YYZ) to Dubai (DXB) today. The flight takes off at 21:45. The total duration of the flight is 12 hours and 45 minutes. What would be the local time when the plane lands?

The following code will allow you to calculate that easily-

for copy/paste pleasure: https://github.com/rokon12/100DaysOfJava/blob/main/src/main/java/com/bazlur/Day010.java

原文链接:How to calculate date and time involving time zone? doesn’t have to be hard.

© 版权声明
THE END
喜欢就支持一下吧
点赞15 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容