java对世界各个时区(timezone)的通用转换处理方法(Java general conversion processing method for each time zone (timezone) of the world).doc
- 1、本文档共19页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
java对世界各个时区(timezone)的通用转换处理方法(Java general conversion processing method for each time zone (timezone) of the world)
java对世界各个时区(timezone)的通用转换处理方法(Java general conversion processing method for each time zone (timezone) of the world)
Java general conversion processing method for each time zone (TimeZone) of the world
In the process of developing international software projects, some special requirements are sometimes met. For example: for example, you do is a shopping website (assuming the server in Shanghai, China) when the order to buy something customers around the world on your website, customers often want to see where the underground single time, for example, I am an American in the new Yorker, I order you on the website after you. I see a Shanghai single time, will feel very strange. As we all know, New York time relative to Shanghai time about 13 hours later, if let customers see the time zone of the local time, will become more in line with the customers time concept, make the customer understand more convenient.
In fact, Java has long been considered the world time zone (TimeZone) of this problem, and gives reasonable solutions, can be more convenient for the world time conversion, a time zone into another time zone. You can see the actual example below (the main () method of running the example).
As to how to know the time zone of the customer, you can calculate the time zone based on the customers IP or the country where the user registers.
Java code 01./*
2 * Created on 2005-6-10
3 * Author Stephen
4 * Email, zhoujianqiang, AT, Gmail, DOT, com
5 * CopyRight (C) 2005-2008, All rights reserved.
6.
07.package com.soft4j.utility;
Eight
09.import java.text.ParseException;
10.import java.text.SimpleDateFormat;
11.import java.util.Date;
12.import java.util.GregorianCalendar;
13.import java.util.TimeZone;
14.import java.util.Vector;
Fifteen
16.import com.soft4j.log.Log;
Seventeen
18./**
19. * some common tools and methods related to date and time
20. * p
21. * date (time) commonly used format (formater), mainly: br
22. * yyyy-MM-dd HH:mm:ss br
* 23.
24. * @author Stephen
25.
您可能关注的文档
- 3、如何理解近代以来无数仁人志士探索国家出路的艰辛历程及其历史意义(3, how to understand the hardships of modern history of countless men and women with high ideals to explore the national way and its historical significance).doc
- 3t6管控12要点(不含售前四步法介绍)]测试题(3T6 control 12 points (without pre-sale, four steps introduction) test questions).doc
- 360°解析杜曼早教及如何使用闪卡【(360 degrees parsing Du early education and how to use flash card).doc
- 3_15品牌生活的卫道士(3_15 brand life guard).doc
- 3周年策划(3rd Anniversary planning).doc
- 3道3年级数学题—智力题, 3分钟之内10人做9人错(3, grade 3 math problems - puzzles, 3 minutes, 10 people do, 9 people wrong).doc
- 4,教育法规概论(高中)(4, an introduction to educational regulations (high school)).doc
- 4.苹果公司的ceo (每日一小故事)(4. Apple Corp's CEO (a little daily story)).doc
- 400斤重的猪如何过一座承重只有200斤的桥呢(How about 400 kilos of pigs crossing a bridge with a weight of only 200 kilos).doc
- 40种让人类量子提升进化至新人类的核心理念(40 core concepts that allow human quantum ascension to evolve into new human beings).doc
- 江西省鹰潭市贵溪市2024年数学六上期末质量检测模拟试题含解析.doc
- 江苏省南京市凤凰花园城小学2024-2025学年六年级数学第一学期期末学业水平测试试题含解析.doc
- 江苏省南京市雨花台区2024年数学六年级第一学期期末学业水平测试试题含解析.doc
- 江西省赣州市定南县2024-2025学年数学六上期末质量检测模拟试题含解析.doc
- 晋城市高平市2024年六年级数学第一学期期末达标检测模拟试题含解析.doc
- 江西省九江市瑞昌市2024-2025学年数学六年级第一学期期末学业水平测试试题含解析.doc
- 江西省吉安市万安县2025届数学六年级第一学期期末联考试题含解析.doc
- 江苏省徐州市明诚小学2025届六年级数学第一学期期末经典试题含解析.doc
- 江西省赣州区2025届六上数学期末综合测试试题含解析.doc
- 江苏省盐城市2024年数学六上期末经典试题含解析.doc
文档评论(0)