我希望时间戳中的句点使用不同于am/pm的符号。这个翻译可以吗?当前格式:dd/mm/yyyy hh:mm aa eg。2019年2月1日下午05:37要求时间:2019年2月1日05:37ều注意“气”ều“代替pm。这是必需的。
ws51t4hk1#
您只需将时间戳值以毫秒为单位传递给下面的函数即可。在这个函数中 Locale 作为默认值传递,所以无论您的电话语言是什么,结果都将相应地返回。
Locale
public static String millisToFormat(long millis) { Calendar cal = Calendar.getInstance(Locale.getDefault()); cal.setTimeZone(tz); cal.setTimeInMillis(millis); SimpleDateFormat sdf = new SimpleDateFormat("dd/mm/yyyy hh:mm aa", Locale.getDefault()); sdf.setTimeZone(TimeZone.getDefault()); return sdf.format(cal.getTime()); }
t1rydlwq2#
指定一个 Locale .
DateTimeFormatter.ofPattern( "hh:mm a" , locale ) // Pass a `Locale` to specify human language and cultural norms for localization.
现代方法使用java.time类,这些类在几年前就已经取代了可怕的遗留类( Date , Calendar , SimpleDateFormat ).这个 Locale 在 DateTimeFormatter 决定了本地化中使用的人类语言和文化规范。
Date
Calendar
SimpleDateFormat
DateTimeFormatter
LocalTime lt = LocalTime.of( 17 , 0 ); DateTimeFormatter f = DateTimeFormatter.ofPattern( "hh:mm a" ); for ( Locale locale : Locale.getAvailableLocales() ) { String output = lt.format( f.withLocale( locale ) ); System.out.println( locale.getDisplayName( Locale.US ) + " ➙ " + output ); }
输出,java11,使用基于openjdk的jvm。
Norwegian Nynorsk ➙ 05:00 ettermiddag Arabic (Jordan) ➙ 05:00 م Bulgarian ➙ 05:00 сл.об. Kabuverdianu ➙ 05:00 pm Low German ➙ 05:00 PM Zulu ➙ 05:00 PM Amharic (Ethiopia) ➙ 05:00 ከሰዓት French (Algeria) ➙ 05:00 PM Tigrinya (Ethiopia) ➙ 05:00 ድሕር ሰዓት Tibetan (China) ➙ 05:00 ཕྱི་དྲོ་ Upper Sorbian ➙ 05:00 popołdnju Quechua (Ecuador) ➙ 05:00 p.m. Tamil (Singapore) ➙ 05:00 பிற்பகல் Latvian ➙ 05:00 pēcpusdienā English (Niue) ➙ 05:00 PM Chinese (Simplified, Singapore) ➙ 05:00 下午 English (Montserrat) ➙ 05:00 PM English (Guernsey) ➙ 05:00 PM English (Jamaica) ➙ 05:00 PM Volapük ➙ 05:00 PM Kako ➙ 05:00 PM Serbian (Montenegro) ➙ 05:00 po podne Swedish (Sweden) ➙ 05:00 em Spanish (Bolivia) ➙ 05:00 p. m. Dzongkha (Bhutan) ➙ 05:00 ཕྱི་ཆ་ Meru ➙ 05:00 ŨG Sakha ➙ 05:00 ЭК English (Zambia) ➙ 05:00 PM French (Mali) ➙ 05:00 PM Breton ➙ 05:00 G.M. Hausa (Nigeria) ➙ 05:00 PM Arabic (Saudi Arabia) ➙ 05:00 م Persian (Afghanistan) ➙ 05:00 بعدازظهر Lower Sorbian (Germany) ➙ 05:00 wótpołdnja Slovak ➙ 05:00 PM Ossetic (Georgia) ➙ 05:00 ӕмбисбоны фӕстӕ Malayalam ➙ 05:00 PM English (Malta) ➙ 05:00 PM English (Liberia) ➙ 05:00 PM Arabic (Chad) ➙ 05:00 م English (Ghana) ➙ 05:00 PM English (Israel) ➙ 05:00 PM Swedish ➙ 05:00 em Czech ➙ 05:00 odp. Greek ➙ 05:00 μ.μ. Central Atlas Tamazight (Morocco) ➙ 05:00 Ḍeffir aza Afrikaans ➙ 05:00 nm. Swahili (Uganda) ➙ 05:00 PM Koyraboro Senni (Mali) ➙ 05:00 Aluula Inari Sami ➙ 05:00 ep. Turkmen (Turkmenistan) ➙ 05:00 günortadan soň Serbian (Cyrillic, Montenegro) ➙ 05:00 по подне Arabic (Egypt) ➙ 05:00 م Lower Sorbian ➙ 05:00 wótpołdnja Lakota (United States) ➙ 05:00 PM Vai (Latin, Liberia) ➙ 05:00 PM Yiddish (World) ➙ 05:00 נאָכמיטאָג Yoruba (Nigeria) ➙ 05:00 Ọ̀sán Northern Sami (Norway) ➙ 05:00 eahketbeaivet Koyra Chiini ➙ 05:00 Aluula Swahili (Congo - Kinshasa) ➙ 05:00 PM Volapük (World) ➙ 05:00 PM English (Palau) ➙ 05:00 PM Polish (Poland) ➙ 05:00 PM Filipino (Philippines) ➙ 05:00 PM Italian (Vatican City) ➙ 05:00 PM Serbian (Serbia and Montenegro) ➙ 05:00 PM Nepali (India) ➙ 05:00 अपराह्न Spanish (Philippines) ➙ 05:00 p. m. Spanish (Spain) ➙ 05:00 p. m. Spanish (Colombia) ➙ 05:00 p. m. Bulgarian (Bulgaria) ➙ 05:00 сл.об. Yiddish ➙ 05:00 נאָכמיטאָג Arabic (Western Sahara) ➙ 05:00 م Bosnian (Latin, Bosnia & Herzegovina) ➙ 05:00 popodne English (St. Vincent & Grenadines) ➙ 05:00 PM Low German (Germany) ➙ 05:00 PM Norwegian Bokmål (Svalbard & Jan Mayen) ➙ 05:00 p.m. Spanish (United States) ➙ 05:00 p. m. Aghem ➙ 05:00 a.k Upper Sorbian (Germany) ➙ 05:00 popołdnju English (United States, Computer) ➙ 05:00 PM English (Europe) ➙ 05:00 PM Arabic (Sudan) ➙ 05:00 م English (St. Kitts & Nevis) ➙ 05:00 PM Hausa (Niger) ➙ 05:00 PM Portuguese (Macau SAR China) ➙ 05:00 da tarde Embu ➙ 05:00 UT Romanian (Romania) ➙ 05:00 p.m. Chinese (Simplified) ➙ 05:00 下午 Luxembourgish (Luxembourg) ➙ 05:00 nomëttes Serbian (Latin, Montenegro) ➙ 05:00 po podne Spanish (Guatemala) ➙ 05:00 p. m. Somali (Kenya) ➙ 05:00 gn. Zarma (Niger) ➙ 05:00 Zaarikay b Basaa (Cameroon) ➙ 05:00 I ɓugajɔp French (St. Pierre & Miquelon) ➙ 05:00 PM Arabic (Comoros) ➙ 05:00 م French (Madagascar) ➙ 05:00 PM Norwegian (Norway, Nynorsk) ➙ 05:00 ettermiddag Spanish (Chile) ➙ 05:00 p. m. Mongolian ➙ 05:00 ү.х Aghem (Cameroon) ➙ 05:00 a.k Kamba (Kenya) ➙ 05:00 Ĩyawĩoo Teso ➙ 05:00 Ebongi Turkish (Turkey) ➙ 05:00 ÖS Basque ➙ 05:00 PM Persian (Iran) ➙ 05:00 بعدازظهر English (Macau SAR China) ➙ 05:00 PM Wolof ➙ 05:00 Ngo Tachelhit (Tifinagh) ➙ 05:00 ⵜⴰⴷⴳⴳⵯⴰⵜ English (Belize) ➙ 05:00 PM Albanian (Albania) ➙ 05:00 e pasdites Arabic (Mauritania) ➙ 05:00 م Spanish (Dominican Republic) ➙ 05:00 p. m. Russian ➙ 05:00 PM Tasawaq (Niger) ➙ 05:00 Zaarikay b Azerbaijani ➙ 05:00 PM Kwasio (Cameroon) ➙ 05:00 kugú Persian ➙ 05:00 بعدازظهر Kalaallisut (Greenland) ➙ 05:00 PM English (Nauru) ➙ 05:00 PM North Ndebele ➙ 05:00 PM Kazakh ➙ 05:00 PM Azerbaijani (Cyrillic) ➙ 05:00 ПМ English (Northern Mariana Islands) ➙ 05:00 PM English (Grenada) ➙ 05:00 PM Turkmen ➙ 05:00 günortadan soň Armenian ➙ 05:00 ԿՀ Tachelhit (Latin) ➙ 05:00 tadggʷat English (Botswana) ➙ 05:00 PM English (Australia) ➙ 05:00 pm English (Cyprus) ➙ 05:00 PM Kabyle (Algeria) ➙ 05:00 n tmeddit Makonde (Tanzania) ➙ 05:00 Chilo Tamil (Malaysia) ➙ 05:00 பிற்பகல் Tigrinya (Eritrea) ➙ 05:00 ድሕር ሰዓት Nuer (South Sudan) ➙ 05:00 TŊ English (Rwanda) ➙ 05:00 PM North Ndebele (Zimbabwe) ➙ 05:00 PM Swedish (Finland) ➙ 05:00 em Shambala ➙ 05:00 nyiaghuo Luo ➙ 05:00 OT Luxembourgish ➙ 05:00 nomëttes Nepali ➙ 05:00 अपराह्न English (Ireland) ➙ 05:00 p.m. Chinese (Singapore) ➙ 05:00 下午 Lingala (Congo - Kinshasa) ➙ 05:00 mpókwa English (Kiribati) ➙ 05:00 PM Ngiemboon (Cameroon) ➙ 05:00 ncwònzém Oromo (Ethiopia) ➙ 05:00 WB Norwegian ➙ 05:00 p.m. Japanese (Japan) ➙ 05:00 午後 Burmese ➙ 05:00 ညနေ Georgian ➙ 05:00 PM Arabic (Israel) ➙ 05:00 م Makhuwa-Meetto ➙ 05:00 mchochil’l Odia (India) ➙ 05:00 PM French (St. Martin) ➙ 05:00 PM Tachelhit ➙ 05:00 ⵜⴰⴷⴳⴳⵯⴰⵜ Kalaallisut ➙ 05:00 PM English (Swaziland) ➙ 05:00 PM Rwa (Tanzania) ➙ 05:00 kyiukonyi Chinese ➙ 05:00 下午 Spanish (Peru) ➙ 05:00 p. m. Makhuwa-Meetto (Mozambique) ➙ 05:00 mchochil’l Samburu ➙ 05:00 Teipa Azerbaijani (Latin) ➙ 05:00 PM Tamil ➙ 05:00 பிற்பகல் English (United Kingdom) ➙ 05:00 pm Langi ➙ 05:00 MUU Chinese (Traditional, Hong Kong SAR China) ➙ 05:00 下午 Arabic (Syria) ➙ 05:00 م Bafia (Cameroon) ➙ 05:00 cɛɛ́nko Tibetan ➙ 05:00 ཕྱི་དྲོ་ Kazakh (Kazakhstan) ➙ 05:00 PM Spanish (Panama) ➙ 05:00 p. m. Tatar (Russia) ➙ 05:00 PM Oromo (Kenya) ➙ 05:00 WB Arabic (Palestinian Territories) ➙ 05:00 م English (American Samoa) ➙ 05:00 PM French (Vanuatu) ➙ 05:00 PM Chinese (Taiwan) ➙ 05:00 下午 Bena ➙ 05:00 pamunyi Kalenjin ➙ 05:00 kooskoliny French (Monaco) ➙ 05:00 PM Cornish ➙ 05:00 p.m. Portuguese (Mozambique) ➙ 05:00 da tarde French (Niger) ➙ 05:00 PM Vai (Latin) ➙ 05:00 PM Shambala (Tanzania) ➙ 05:00 nyiaghuo Colognian ➙ 05:00 Uhr nommendaachs Urdu (India) ➙ 05:00 PM Lingala ➙ 05:00 mpókwa English (Jersey) ➙ 05:00 PM Swiss German (Switzerland) ➙ 05:00 am Namittag Lingala (Central African Republic) ➙ 05:00 mpókwa English (Christmas Island) ➙ 05:00 PM Luyia (Kenya) ➙ 05:00 p.m. Portuguese ➙ 05:00 PM English (Austria) ➙ 05:00 PM Galician ➙ 05:00 p.m. Kako (Cameroon) ➙ 05:00 PM Serbian (Cyrillic) ➙ 05:00 по подне Cantonese (Simplified, China) ➙ 05:00 下午 Spanish (Equatorial Guinea) ➙ 05:00 p. m. Kannada (India) ➙ 05:00 ಅಪರಾಹ್ನ Arabic (Yemen) ➙ 05:00 م Tongan ➙ 05:00 efiafi English (Sint Maarten) ➙ 05:00 PM Irish ➙ 05:00 i.n. Quechua ➙ 05:00 p.m. Russian (Kazakhstan) ➙ 05:00 PM English (Tanzania) ➙ 05:00 PM Estonian ➙ 05:00 PM English (Puerto Rico) ➙ 05:00 PM Mundang ➙ 05:00 lilli Korean (North Korea) ➙ 05:00 오후 Indonesian ➙ 05:00 PM Pashto ➙ 05:00 غ.و. Shona ➙ 05:00 PM Dutch (Suriname) ➙ 05:00 p.m. Rombo ➙ 05:00 kingoto English (Bahamas) ➙ 05:00 PM Khmer ➙ 05:00 PM Standard Moroccan Tamazight ➙ 05:00 ⵜⴰⴷⴳⴳⵯⴰⵜ French (New Caledonia) ➙ 05:00 PM Belarusian ➙ 05:00 PM Manx ➙ 05:00 p.m. Spanish ➙ 05:00 p. m. Duala ➙ 05:00 ebyámu Scottish Gaelic (United Kingdom) ➙ 05:00 f Ngomba ➙ 05:00 ŋka mbɔ́t nji Dutch (Caribbean Netherlands) ➙ 05:00 p.m. French (Cameroon) ➙ 05:00 soir Swiss German ➙ 05:00 am Namittag Uzbek (Cyrillic, Uzbekistan) ➙ 05:00 ТК Punjabi (Gurmukhi, India) ➙ 05:00 ਬਾ.ਦੁ. English (Kenya) ➙ 05:00 PM Gusii ➙ 05:00 Mog Morisyen ➙ 05:00 PM Asu (Tanzania) ➙ 05:00 ichamthi Teso (Uganda) ➙ 05:00 Ebongi Japanese ➙ 05:00 午後 French (Senegal) ➙ 05:00 PM Odia ➙ 05:00 PM Bodo ➙ 05:00 बेलासे French (Morocco) ➙ 05:00 p.m. Portuguese (Luxembourg) ➙ 05:00 da tarde French (St. Barthélemy) ➙ 05:00 PM English (Netherlands) ➙ 05:00 PM Metaʼ (Cameroon) ➙ 05:00 PM Lingala (Congo - Brazzaville) ➙ 05:00 mpókwa Telugu ➙ 05:00 PM Slovenian ➙ 05:00 pop. Korean (South Korea) ➙ 05:00 오후 Greek (Cyprus) ➙ 05:00 μ.μ. Marathi (India) ➙ 05:00 म.उ. Hausa ➙ 05:00 PM Spanish (Mexico) ➙ 05:00 p. m. Northern Luri (Iran) ➙ 05:00 PM Swiss German (France) ➙ 05:00 am Namittag Spanish (Honduras) ➙ 05:00 p. m. Hungarian (Hungary) ➙ 05:00 du. Fulah (Senegal) ➙ 05:00 kikiiɗe Sangu ➙ 05:00 Pashamihe Albanian (Macedonia) ➙ 05:00 e pasdites Serbian (Cyrillic, Bosnia & Herzegovina) ➙ 05:00 по подне Finnish ➙ 05:00 ip. Uzbek ➙ 05:00 TK Bosnian (Cyrillic) ➙ 05:00 поподне Estonian (Estonia) ➙ 05:00 PM Serbian (Latin) ➙ 05:00 po podne English (South Sudan) ➙ 05:00 PM Swahili ➙ 05:00 PM Tibetan (India) ➙ 05:00 ཕྱི་དྲོ་ Western Frisian (Netherlands) ➙ 05:00 PM Arabic (Oman) ➙ 05:00 م Turkish (Cyprus) ➙ 05:00 ÖS Kwasio ➙ 05:00 kugú Romansh ➙ 05:00 PM English (Madagascar) ➙ 05:00 PM French (Burundi) ➙ 05:00 PM Uzbek (Latin, Uzbekistan) ➙ 05:00 TK Bangla ➙ 05:00 PM Duala (Cameroon) ➙ 05:00 ebyámu German (Italy) ➙ 05:00 nachm. Northern Luri (Iraq) ➙ 05:00 PM Vai (Vai) ➙ 05:00 PM Kannada ➙ 05:00 ಅಪರಾಹ್ನ French (Tunisia) ➙ 05:00 PM Serbian (Serbia) ➙ 05:00 по подне German (Switzerland) ➙ 05:00 nachm. Bangla (Bangladesh) ➙ 05:00 PM Ngiemboon ➙ 05:00 ncwònzém French (French Polynesia) ➙ 05:00 PM English (South Africa) ➙ 05:00 PM Gujarati ➙ 05:00 PM Portuguese (Equatorial Guinea) ➙ 05:00 da tarde Vunjo (Tanzania) ➙ 05:00 kyiukonyi Machame (Tanzania) ➙ 05:00 kyiukonyi English (Tuvalu) ➙ 05:00 PM Lao ➙ 05:00 ຫຼັງທ່ຽງ French (France) ➙ 05:00 PM English (Pitcairn Islands) ➙ 05:00 PM English (Marshall Islands) ➙ 05:00 PM French (Benin) ➙ 05:00 PM Chinese (Traditional) ➙ 05:00 下午 Church Slavic (Russia) ➙ 05:00 PM Chinese (Simplified, Hong Kong SAR China) ➙ 05:00 下午 Dutch (Netherlands) ➙ 05:00 p.m. Sakha (Russia) ➙ 05:00 ЭК English (Guyana) ➙ 05:00 PM Pashto (Afghanistan) ➙ 05:00 غ.و. Bosnian (Latin) ➙ 05:00 popodne Kyrgyz ➙ 05:00 түштөн кийинки Masai ➙ 05:00 Ɛndámâ Jola-Fonyi (Senegal) ➙ 05:00 PM Ossetic ➙ 05:00 ӕмбисбоны фӕстӕ Bosnian (Cyrillic, Bosnia & Herzegovina) ➙ 05:00 поподне Dutch (Curaçao) ➙ 05:00 p.m. Arabic (Algeria) ➙ 05:00 م Slovak (Slovakia) ➙ 05:00 PM Portuguese (Switzerland) ➙ 05:00 da tarde French (Equatorial Guinea) ➙ 05:00 PM Fulah (Cameroon) ➙ 05:00 kikiiɗe Amharic ➙ 05:00 ከሰዓት English (Nigeria) ➙ 05:00 PM French (Côte d’Ivoire) ➙ 05:00 PM Kikuyu (Kenya) ➙ 05:00 Hwaĩ-inĩ English (Pakistan) ➙ 05:00 PM Chinese (China) ➙ 05:00 下午 English (St. Lucia) ➙ 05:00 PM Kinyarwanda ➙ 05:00 PM Bodo (India) ➙ 05:00 बेलासे Wolof (Senegal) ➙ 05:00 Ngo Hebrew ➙ 05:00 אחה״צ Manx (Isle of Man) ➙ 05:00 p.m. Macedonian (Macedonia) ➙ 05:00 попладне English (Trinidad & Tobago) ➙ 05:00 PM Taita ➙ 05:00 luma lwa p Slovenian (Slovenia) ➙ 05:00 pop. French (Haiti) ➙ 05:00 PM Telugu (India) ➙ 05:00 PM Dutch (Sint Maarten) ➙ 05:00 p.m. Northern Luri ➙ 05:00 PM Koyraboro Senni ➙ 05:00 Aluula Chechen ➙ 05:00 PM French (Congo - Brazzaville) ➙ 05:00 PM French (Belgium) ➙ 05:00 PM Ngomba (Cameroon) ➙ 05:00 ŋka mbɔ́t nji Maltese (Malta) ➙ 05:00 PM Spanish (Venezuela) ➙ 05:00 p. m. Malagasy ➙ 05:00 PM Marathi ➙ 05:00 म.उ. Meru (Kenya) ➙ 05:00 ŨG Korean ➙ 05:00 오후 Low German (Netherlands) ➙ 05:00 PM English (Bermuda) ➙ 05:00 PM Norwegian Bokmål (Norway) ➙ 05:00 p.m. Akan ➙ 05:00 EW Sena ➙ 05:00 PM Makonde ➙ 05:00 Chilo Dzongkha ➙ 05:00 ཕྱི་ཆ་ Kabuverdianu (Cape Verde) ➙ 05:00 pm Metaʼ ➙ 05:00 PM Vietnamese (Vietnam) ➙ 05:00 CH English (Vanuatu) ➙ 05:00 PM English (United States) ➙ 05:00 PM Tongan (Tonga) ➙ 05:00 efiafi Morisyen (Mauritius) ➙ 05:00 PM Sena (Mozambique) ➙ 05:00 PM French (Burkina Faso) ➙ 05:00 PM Punjabi (Gurmukhi) ➙ 05:00 ਬਾ.ਦੁ. Italian (San Marino) ➙ 05:00 PM French (Mayotte) ➙ 05:00 PM Gujarati (India) ➙ 05:00 PM Sichuan Yi (China) ➙ 05:00 ꁯꋒ Punjabi (Arabic, Pakistan) ➙ 05:00 PM Asturian ➙ 05:00 de la tarde French (Réunion) ➙ 05:00 PM Finnish (Finland) ➙ 05:00 ip. Cantonese (Simplified) ➙ 05:00 下午 Catalan (France) ➙ 05:00 p. m. Serbian (Latin, Bosnia & Herzegovina) ➙ 05:00 po podne Bangla (India) ➙ 05:00 PM French (Guadeloupe) ➙ 05:00 PM Punjabi ➙ 05:00 ਬਾ.ਦੁ. Standard Moroccan Tamazight (Morocco) ➙ 05:00 ⵜⴰⴷⴳⴳⵯⴰⵜ Ukrainian (Ukraine) ➙ 05:00 пп French (Djibouti) ➙ 05:00 PM Rundi ➙ 05:00 Z.MW. Tajik ➙ 05:00 па. чо. Rwa ➙ 05:00 kyiukonyi Hungarian ➙ 05:00 du. French (Switzerland) ➙ 05:00 PM English (Norfolk Island) ➙ 05:00 PM Tasawaq ➙ 05:00 Zaarikay b Hausa (Ghana) ➙ 05:00 PM Serbian (Cyrillic, Kosovo) ➙ 05:00 по подне Bambara ➙ 05:00 PM Arabic (South Sudan) ➙ 05:00 م English (Guam) ➙ 05:00 PM Dutch (Aruba) ➙ 05:00 p.m. German (Belgium) ➙ 05:00 nachm. English (Anguilla) ➙ 05:00 PM English (Cameroon) ➙ 05:00 PM Soga (Uganda) ➙ 05:00 Eigulo Czech (Czechia) ➙ 05:00 odp. Turkish ➙ 05:00 ÖS Catalan (Spain) ➙ 05:00 p. m. Chiga ➙ 05:00 PM Romansh (Switzerland) ➙ 05:00 PM Nyankole (Uganda) ➙ 05:00 PM Russian (Moldova) ➙ 05:00 PM Malay (Malaysia) ➙ 05:00 PTG Tamil (Sri Lanka) ➙ 05:00 பிற்பகல் Bafia ➙ 05:00 cɛɛ́nko English (Tonga) ➙ 05:00 PM Welsh ➙ 05:00 yh English (Papua New Guinea) ➙ 05:00 PM French (Central African Republic) ➙ 05:00 PM Portuguese (Timor-Leste) ➙ 05:00 da tarde Albanian ➙ 05:00 e pasdites French ➙ 05:00 PM Tajik (Tajikistan) ➙ 05:00 па. чо. English (Eritrea) ➙ 05:00 PM Quechua (Peru) ➙ 05:00 p.m. Serbian (Bosnia & Herzegovina) ➙ 05:00 по подне Spanish (Paraguay) ➙ 05:00 p. m. German ➙ 05:00 nachm. Spanish (Ecuador) ➙ 05:00 p. m. Konkani (India) ➙ 05:00 म.नं. Ganda (Uganda) ➙ 05:00 PM Zulu (South Africa) ➙ 05:00 PM French (Togo) ➙ 05:00 PM Serbian (Latin, Kosovo) ➙ 05:00 po podne English (Philippines) ➙ 05:00 PM Igbo (Nigeria) ➙ 05:00 P.M. French (Guinea) ➙ 05:00 PM Prussian (World) ➙ 05:00 PM Chiga (Uganda) ➙ 05:00 PM Chinese (Simplified, Macau SAR China) ➙ 05:00 下午 Colognian (Germany) ➙ 05:00 Uhr nommendaachs Ganda ➙ 05:00 PM Russian (Russia) ➙ 05:00 PM Northern Sami (Finland) ➙ 05:00 eb Fulah ➙ 05:00 kikiiɗe English (Dominica) ➙ 05:00 PM English (Cook Islands) ➙ 05:00 PM Sindhi ➙ 05:00 منجهند، شام Arabic (Morocco) ➙ 05:00 م Irish (Ireland) ➙ 05:00 i.n. English (Burundi) ➙ 05:00 PM English (Antigua & Barbuda) ➙ 05:00 PM French (Chad) ➙ 05:00 PM English (Samoa) ➙ 05:00 PM French (Luxembourg) ➙ 05:00 PM Embu (Kenya) ➙ 05:00 UT Bemba (Zambia) ➙ 05:00 akasuba Soga ➙ 05:00 Eigulo Ewondo (Cameroon) ➙ 05:00 ngəgógəle French (Congo - Kinshasa) ➙ 05:00 PM Somali ➙ 05:00 gn. Rundi (Burundi) ➙ 05:00 Z.MW. English (Namibia) ➙ 05:00 PM Arabic (Eritrea) ➙ 05:00 م Kabyle ➙ 05:00 n tmeddit Malay ➙ 05:00 PTG Nuer ➙ 05:00 TŊ Shona (Zimbabwe) ➙ 05:00 PM Prussian ➙ 05:00 PM Hebrew (Israel) ➙ 05:00 אחה״צ Uyghur ➙ 05:00 چۈشتىن كېيىن Spanish (Ceuta & Melilla) ➙ 05:00 p. m. Thai (Thailand, TH, Thai Digits) ➙ 05:00 หลังเที่ยง Hindi ➙ 05:00 अपराह्न French (Seychelles) ➙ 05:00 PM Catalan (Italy) ➙ 05:00 p. m. Langi (Tanzania) ➙ 05:00 MUU English (Sierra Leone) ➙ 05:00 PM Teso (Kenya) ➙ 05:00 Ebongi Norwegian (Norway) ➙ 05:00 p.m. Catalan (Andorra) ➙ 05:00 p. m. Chinese (Traditional, Macau SAR China) ➙ 05:00 下午 English (St. Helena) ➙ 05:00 PM Vai ➙ 05:00 PM Quechua (Bolivia) ➙ 05:00 p.m. Hawaiian (United States) ➙ 05:00 PM Vietnamese ➙ 05:00 CH French (Canada) ➙ 05:00 p.m. German (Luxembourg) ➙ 05:00 nachm. Albanian (Kosovo) ➙ 05:00 e pasdites Jola-Fonyi ➙ 05:00 PM English (Cayman Islands) ➙ 05:00 PM Maltese ➙ 05:00 PM Italian (Switzerland) ➙ 05:00 PM German (Germany) ➙ 05:00 nachm. Sinhala (Sri Lanka) ➙ 05:00 ප.ව. Luo (Kenya) ➙ 05:00 OT English (Denmark) ➙ 05:00 PM Yangben ➙ 05:00 kisɛ́ndɛ Somali (Djibouti) ➙ 05:00 gn. Lithuanian (Lithuania) ➙ 05:00 popiet Italian (Italy) ➙ 05:00 PM Esperanto ➙ 05:00 ptm Kamba ➙ 05:00 Ĩyawĩoo Arabic (Somalia) ➙ 05:00 م English (Zimbabwe) ➙ 05:00 PM Romanian ➙ 05:00 p.m. Esperanto (World) ➙ 05:00 ptm Ewe ➙ 05:00 ɣetrɔ English (U.S. Outlying Islands) ➙ 05:00 PM Norwegian Nynorsk (Norway) ➙ 05:00 ettermiddag French (Mauritius) ➙ 05:00 PM Polish ➙ 05:00 PM Northern Sami (Sweden) ➙ 05:00 eahketbeaivet English (Tokelau) ➙ 05:00 PM English (Slovenia) ➙ 05:00 PM Mundang (Cameroon) ➙ 05:00 lilli Urdu ➙ 05:00 PM Uzbek (Arabic) ➙ 05:00 PM Vai (Vai, Liberia) ➙ 05:00 PM Samburu (Kenya) ➙ 05:00 Teipa Northern Sami ➙ 05:00 eahketbeaivet Portuguese (Guinea-Bissau) ➙ 05:00 da tarde Lao (Laos) ➙ 05:00 ຫຼັງທ່ຽງ Cherokee ➙ 05:00 ᏒᎯᏱᎢᏗᏢ Arabic (Lebanon) ➙ 05:00 م Afrikaans (South Africa) ➙ 05:00 nm. Malay (Singapore) ➙ 05:00 PTG Ewe (Togo) ➙ 05:00 ɣetrɔ Lingala (Angola) ➙ 05:00 mpókwa Belarusian (Belarus) ➙ 05:00 PM Fulah (Guinea) ➙ 05:00 kikiiɗe Cantonese (Traditional) ➙ 05:00 下午 Indonesian (Indonesia) ➙ 05:00 PM Spanish (Belize) ➙ 05:00 p.m. Arabic (United Arab Emirates) ➙ 05:00 م Croatian (Croatia) ➙ 05:00 PM Luyia ➙ 05:00 p.m. Assamese ➙ 05:00 অপৰাহ্ন Rombo (Tanzania) ➙ 05:00 kingoto Italian ➙ 05:00 PM Portuguese (Cape Verde) ➙ 05:00 da tarde Kashmiri (India) ➙ 05:00 PM Ukrainian ➙ 05:00 пп Burmese (Myanmar (Burma)) ➙ 05:00 ညနေ Urdu (Pakistan) ➙ 05:00 PM Mongolian (Mongolia) ➙ 05:00 ү.х Danish (Denmark) ➙ 05:00 PM English (Micronesia) ➙ 05:00 PM Spanish (Puerto Rico) ➙ 05:00 p. m. Walser (Switzerland) ➙ 05:00 PM Mazanderani ➙ 05:00 PM English (Belgium) ➙ 05:00 PM Sichuan Yi ➙ 05:00 ꁯꋒ Tatar ➙ 05:00 PM French (Wallis & Futuna) ➙ 05:00 PM Russian (Belarus) ➙ 05:00 PM Mazanderani (Iran) ➙ 05:00 PM Nama ➙ 05:00 ǃuias Faroese (Denmark) ➙ 05:00 PM English (Singapore) ➙ 05:00 PM Ewe (Ghana) ➙ 05:00 ɣetrɔ Arabic (Bahrain) ➙ 05:00 م Kalenjin (Kenya) ➙ 05:00 kooskoliny Central Atlas Tamazight ➙ 05:00 Ḍeffir aza Friulian ➙ 05:00 p. Oromo ➙ 05:00 WB Hindi (India) ➙ 05:00 अपराह्न English (Switzerland) ➙ 05:00 PM Asu ➙ 05:00 ichamthi Yoruba (Benin) ➙ 05:00 Ɔ̀sán Faroese (Faroe Islands) ➙ 05:00 PM Asturian (Spain) ➙ 05:00 de la tarde French (Comoros) ➙ 05:00 PM Bena (Tanzania) ➙ 05:00 pamunyi French (Martinique) ➙ 05:00 PM English (Sudan) ➙ 05:00 PM Spanish (Argentina) ➙ 05:00 p. m. English (Malaysia) ➙ 05:00 PM Japanese (Japan, JP, Japanese Calendar) ➙ 05:00 午後 Spanish (El Salvador) ➙ 05:00 p. m. Portuguese (Brazil) ➙ 05:00 PM Malayalam (India) ➙ 05:00 PM Sangu (Tanzania) ➙ 05:00 Pashamihe Filipino ➙ 05:00 PM English (Falkland Islands) ➙ 05:00 PM Uzbek (Cyrillic) ➙ 05:00 ТК Icelandic (Iceland) ➙ 05:00 e.h. Cantonese (Traditional, Hong Kong SAR China) ➙ 05:00 下午 Armenian (Armenia) ➙ 05:00 ԿՀ English (Gambia) ➙ 05:00 PM English (Diego Garcia) ➙ 05:00 PM Faroese ➙ 05:00 PM Nepali (Nepal) ➙ 05:00 अपराह्न Croatian ➙ 05:00 PM Portuguese (São Tomé & Príncipe) ➙ 05:00 da tarde Akan (Ghana) ➙ 05:00 EW Lithuanian ➙ 05:00 popiet Uzbek (Arabic, Afghanistan) ➙ 05:00 PM Friulian (Italy) ➙ 05:00 p. Tamil (India) ➙ 05:00 பிற்பகல் Chakma ➙ 05:00 PM English (Sweden) ➙ 05:00 PM French (French Guiana) ➙ 05:00 PM Lakota ➙ 05:00 PM Chinese (Simplified, China) ➙ 05:00 下午 Icelandic ➙ 05:00 e.h. Spanish (Latin America) ➙ 05:00 p.m. Sinhala ➙ 05:00 ප.ව. Portuguese (Angola) ➙ 05:00 da tarde English (World) ➙ 05:00 PM English ➙ 05:00 PM Gusii (Kenya) ➙ 05:00 Mog Swiss German (Liechtenstein) ➙ 05:00 am Namittag Chakma (Bangladesh) ➙ 05:00 PM Spanish (Canary Islands) ➙ 05:00 p. m. Catalan ➙ 05:00 p. m. Russian (Kyrgyzstan) ➙ 05:00 PM French (Mauritania) ➙ 05:00 PM Arabic (Tunisia) ➙ 05:00 م Kashmiri ➙ 05:00 PM Chinese (Traditional, Taiwan) ➙ 05:00 下午 Bambara (Mali) ➙ 05:00 PM Cornish (United Kingdom) ➙ 05:00 p.m. Uyghur (China) ➙ 05:00 چۈشتىن كېيىن Assamese (India) ➙ 05:00 অপৰাহ্ন Spanish (Brazil) ➙ 05:00 p.m. Chinese (Hong Kong SAR China) ➙ 05:00 下午 Koyra Chiini (Mali) ➙ 05:00 Aluula Swahili (Kenya) ➙ 05:00 PM English (Solomon Islands) ➙ 05:00 PM Thai (Thailand) ➙ 05:00 หลังเที่ยง Kinyarwanda (Rwanda) ➙ 05:00 PM Cherokee (United States) ➙ 05:00 ᏒᎯᏱᎢᏗᏢ Tachelhit (Tifinagh, Morocco) ➙ 05:00 ⵜⴰⴷⴳⴳⵯⴰⵜ Arabic (Iraq) ➙ 05:00 م Nyankole ➙ 05:00 PM Cantonese ➙ 05:00 下午 Machame ➙ 05:00 kyiukonyi English (Malawi) ➙ 05:00 PM Nama (Namibia) ➙ 05:00 ǃuias Macedonian ➙ 05:00 попладне English (British Indian Ocean Territory) ➙ 05:00 PM Arabic (Qatar) ➙ 05:00 م English (Germany) ➙ 05:00 PM Punjabi (Arabic) ➙ 05:00 PM English (Cocos (Keeling) Islands) ➙ 05:00 PM Bosnian ➙ 05:00 popodne Romanian (Moldova) ➙ 05:00 p.m. English (Finland) ➙ 05:00 PM Portuguese (Portugal) ➙ 05:00 da tarde Western Frisian ➙ 05:00 PM Azerbaijani (Cyrillic, Azerbaijan) ➙ 05:00 ПМ Thai ➙ 05:00 หลังเที่ยง Taita (Kenya) ➙ 05:00 luma lwa p Central Kurdish (Iraq) ➙ 05:00 د.ن Tachelhit (Latin, Morocco) ➙ 05:00 tadggʷat Spanish (Cuba) ➙ 05:00 p.m. Arabic ➙ 05:00 م English (Seychelles) ➙ 05:00 PM English (U.S. Virgin Islands) ➙ 05:00 PM Hawaiian ➙ 05:00 PM Basque (Spain) ➙ 05:00 PM English (Uganda) ➙ 05:00 PM English (New Zealand) ➙ 05:00 PM Zarma ➙ 05:00 Zaarikay b Spanish (Uruguay) ➙ 05:00 p. m. Basaa ➙ 05:00 I ɓugajɔp Masai (Kenya) ➙ 05:00 Ɛndámâ Russian (Ukraine) ➙ 05:00 PM Sango (Central African Republic) ➙ 05:00 LK Greek (Greece) ➙ 05:00 μ.μ. Yangben (Cameroon) ➙ 05:00 kisɛ́ndɛ Uzbek (Latin) ➙ 05:00 TK Sango ➙ 05:00 LK Danish (Greenland) ➙ 05:00 PM English (Fiji) ➙ 05:00 PM German (Liechtenstein) ➙ 05:00 nachm. English (Barbados) ➙ 05:00 PM Khmer (Cambodia) ➙ 05:00 PM Inari Sami (Finland) ➙ 05:00 ep. Croatian (Bosnia & Herzegovina) ➙ 05:00 PM German (Austria) ➙ 05:00 nachm. Central Kurdish (Iran) ➙ 05:00 د.ن Dutch ➙ 05:00 p.m. Luba-Katanga (Congo - Kinshasa) ➙ 05:00 Dilolo Catalan (Spain, Valencian) ➙ 05:00 p. m. Arabic (World) ➙ 05:00 م Somali (Somalia) ➙ 05:00 gn. Latvian (Latvia) ➙ 05:00 pēcpusdienā Central Kurdish ➙ 05:00 د.ن Spanish (Costa Rica) ➙ 05:00 p. m. French (Gabon) ➙ 05:00 PM Arabic (Kuwait) ➙ 05:00 م Serbian ➙ 05:00 по подне Arabic (Libya) ➙ 05:00 م Serbian (Cyrillic, Serbia) ➙ 05:00 по подне Bemba ➙ 05:00 akasuba English (Mauritius) ➙ 05:00 PM Danish ➙ 05:00 PM Walser ➙ 05:00 PM Galician (Spain) ➙ 05:00 p.m. English (Isle of Man) ➙ 05:00 PM Azerbaijani (Latin, Azerbaijan) ➙ 05:00 PM English (Lesotho) ➙ 05:00 PM Igbo ➙ 05:00 P.M. English (Hong Kong SAR China) ➙ 05:00 PM English (Gibraltar) ➙ 05:00 PM Chechen (Russia) ➙ 05:00 PM English (Canada) ➙ 05:00 p.m. Scottish Gaelic ➙ 05:00 f Georgian (Georgia) ➙ 05:00 PM French (Syria) ➙ 05:00 PM Swahili (Tanzania) ➙ 05:00 PM French (Rwanda) ➙ 05:00 PM Somali (Ethiopia) ➙ 05:00 gn. Dutch (Belgium) ➙ 05:00 p.m. Arabic (Djibouti) ➙ 05:00 م Malagasy (Madagascar) ➙ 05:00 PM Welsh (United Kingdom) ➙ 05:00 yh English (British Virgin Islands) ➙ 05:00 PM Church Slavic ➙ 05:00 PM Ossetic (Russia) ➙ 05:00 ӕмбисбоны фӕстӕ Serbian (Latin, Serbia) ➙ 05:00 po podne English (Turks & Caicos Islands) ➙ 05:00 PM Kyrgyz (Kyrgyzstan) ➙ 05:00 түштөн кийинки Swedish (Åland Islands) ➙ 05:00 em Afrikaans (Namibia) ➙ 05:00 nm. Vunjo ➙ 05:00 kyiukonyi English (India) ➙ 05:00 PM Luba-Katanga ➙ 05:00 Dilolo Kikuyu ➙ 05:00 Hwaĩ-inĩ Yoruba ➙ 05:00 Ọ̀sán Spanish (Nicaragua) ➙ 05:00 p. m. Norwegian Bokmål ➙ 05:00 p.m. Fulah (Mauritania) ➙ 05:00 kikiiɗe Sindhi (Pakistan) ➙ 05:00 منجهند، شام Masai (Tanzania) ➙ 05:00 Ɛndámâ Tigrinya ➙ 05:00 ድሕር ሰዓት Konkani ➙ 05:00 म.नं. Ewondo ➙ 05:00 ngəgógəle Malay (Brunei) ➙ 05:00 PTG Chakma (India) ➙ 05:00 PM Breton (France) ➙ 05:00 G.M.
java.time框架内置于Java8及更高版本中。这些类取代了旧的遗留日期时间类,例如 java.util.Date , Calendar , & SimpleDateFormat .现在处于维护模式的joda time项目建议迁移到java.time类。要了解更多信息,请参阅oracle教程。和搜索堆栈溢出的许多例子和解释。规格为jsr 310。您可以直接与数据库交换java.time对象。使用符合jdbc 4.2或更高版本的jdbc驱动程序。不需要线,不需要线 java.sql.* 班级。从哪里获得java.time类?JavaSE8、JavaSE9、JavaSE10、JavaSE11及更高版本—标准JavaAPI的一部分,带有捆绑实现。Java9添加了一些次要的特性和修复。java se 6和java se 7大部分java.time功能都是通过三个十个后端口后端口移植到Java6和Java7的。安卓android包java.time类的更高版本实现。对于早期的android(<26),threetenabp项目采用了threeten backport(如上所述)。了解如何使用threetenabp…。
java.util.Date
java.sql.*
de90aj5v3#
你可以用 SimpleDateFormat 为了这份工作。你指定了一个符号(例如。 dd/MM/yyyy 或者 dd/MM/yyyy HH:mm:ss ,您的时间戳将以该格式显示(例如25/01/2019或25/01/2019 23:16:54)例子:
dd/MM/yyyy
dd/MM/yyyy HH:mm:ss
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy"); String dateString = formatter.format(new Date(Long.parseLong(timestamp))); txtDate.setText(dateString);
3条答案
按热度按时间ws51t4hk1#
您只需将时间戳值以毫秒为单位传递给下面的函数即可。
在这个函数中
Locale
作为默认值传递,所以无论您的电话语言是什么,结果都将相应地返回。t1rydlwq2#
热释光;博士
指定一个
Locale
.是的,你可以本地化上午/下午
现代方法使用java.time类,这些类在几年前就已经取代了可怕的遗留类(
Date
,Calendar
,SimpleDateFormat
).这个
Locale
在DateTimeFormatter
决定了本地化中使用的人类语言和文化规范。输出,java11,使用基于openjdk的jvm。
关于java.time
java.time框架内置于Java8及更高版本中。这些类取代了旧的遗留日期时间类,例如
java.util.Date
,Calendar
, &SimpleDateFormat
.现在处于维护模式的joda time项目建议迁移到java.time类。
要了解更多信息,请参阅oracle教程。和搜索堆栈溢出的许多例子和解释。规格为jsr 310。
您可以直接与数据库交换java.time对象。使用符合jdbc 4.2或更高版本的jdbc驱动程序。不需要线,不需要线
java.sql.*
班级。从哪里获得java.time类?
JavaSE8、JavaSE9、JavaSE10、JavaSE11及更高版本—标准JavaAPI的一部分,带有捆绑实现。
Java9添加了一些次要的特性和修复。
java se 6和java se 7
大部分java.time功能都是通过三个十个后端口后端口移植到Java6和Java7的。
安卓
android包java.time类的更高版本实现。
对于早期的android(<26),threetenabp项目采用了threeten backport(如上所述)。了解如何使用threetenabp…。
de90aj5v3#
你可以用
SimpleDateFormat
为了这份工作。你指定了一个符号(例如。dd/MM/yyyy
或者dd/MM/yyyy HH:mm:ss
,您的时间戳将以该格式显示(例如25/01/2019或25/01/2019 23:16:54)例子: