DateFormat tsis muaj xov zoo. Yog hais tias ntau threads siv tib yam khoom DateFormat yam tsis muaj synchronization koj tuaj yeem tau txais cov txiaj ntsig tsis xav tau. Yog li koj yuav tsum tau synchronize nkag mus rau cov khoom DateFormat, siv ThreadLocal hloov pauv lossis siv lwm qhov Date API xws li Joda-Time. static yuav tsum tsis muaj teeb meem.
Yuav tsum DateTimeFormatter zoo li qub?
Cov chav kawm DateTimeFormatter yog ob qho tib si hloov tsis tau thiab xov zoo; nws tuaj yeem (thiab yuav tsum) muab rau ib qho zoo li qub qhov tsim nyog.
Is SimpleDateFormat xov-kev nyab xeeb yog qhov tseeb b cuav?
Is SimpleDateFormat xov zoo? Piav: SimpleDateFormat tsis yog xov zoo. Hauv ib puag ncig multithreaded, peb yuav tsum tswj cov xov kom meej.
Kuv tuaj yeem siv dab tsi los hloov SimpleDateFormat?
Time formatting and parsing
DateTimeFormatter yog ib qho hloov tshiab rau SimpleDateFormat qub uas yog xov-zoo thiab muab kev ua haujlwm ntxiv.
Puas yog qhov chaw zoo li qub ntawm hom ntawv Java Dateformat uas tsis muaj xov zoo?
8 Teb. DateFormats tsis yog xov-kev nyab xeeb, txhais tau tias lawv tuav tus sawv cev sab hauv ntawm lub xeev. Kev siv lawv nyob rau hauv cov ntsiab lus zoo li qub tuaj yeem ua rau qee cov kab mob coj txawv txawv yog tias ntau cov xov nkag mus rau tib qho piv txwv ib txhij.