Puas yog LocalDateTime xov zoo?
Puas yog LocalDateTime xov zoo?

Video: Puas yog LocalDateTime xov zoo?

Video: Puas yog LocalDateTime xov zoo?
Video: "Puag Yoj Mas" [OFFICIAL MUSIC VIDEO] - KT Killing Em 2024, Kaum ib hlis
Anonim

123456789 tuaj yeem khaws cia rau hauv a LocalDateTime . Cov chav kawm no tsis khaws lossis sawv cev rau lub sijhawm. Hloov chaw, nws yog ib qho kev piav qhia ntawm hnub, raws li siv rau hnub yug, ua ke nrog lub sijhawm hauv zos raws li pom ntawm lub moos ntsa. Cov chav no yog immutable thiab xov - nyab xeeb.

Ua raws li qhov no saib, LocalDateTime puas muaj sijhawm?

LocalDateTime yog hnub tim tsis muaj ib lub sij hawm-zone . Koj teev cov thaj tsam offset format cim nyob rau hauv hom, txawm li cas los xij, LocalDateTime tsis yog muaj cov ntaub ntawv zoo li no.

Ib yam li ntawd, yog DateTimeFormatter xov zoo? DateTimeFormatter yog ib tug formatter uas yog siv los luam thiab parse hnub-time khoom. Nws tau raug qhia hauv Java 8. DateTimeFormatter yog immutable thiab xov - nyab xeeb . Nrhiav tus lej los luam tawm hnub-lub sij hawm khoom nrog muab formatter.

Tib neeg kuj nug, LocalDateTime tam sim no () rov qab li cas?

tam sim no () tam sim no txoj kev a LocalDateTime chav kawm siv tau cov tam sim no hnub tim-lub sij hawm los ntawm lub kaw lus moos nyob rau hauv lub default time-zone. Txoj kev no yuav rov qab LocalDateTime raws li lub kaw lus moos nrog lub sijhawm ua haujlwm thaj tsam kom tau txais tam sim no hnub tim.

Puas yog LocalDateTime yog UTC?

LocalDateTime tsis muaj lub tswv yim ntawm lub sijhawm, tsuas yog muab qhov xoom offset UTC +0.

Pom zoo: