[英]Given a DateTime object, how do I get DateTimeZone in Joda Time?
As the title describe, if I have a DateTime
object in JodaTime: 如标题所述,如果我在JodaTime中有一个DateTime
对象:
import org.joda.time.DateTime
val currentDateTime = new DateTime()
the variable currentDateTime
should give me the date and time in my local timezone. 变量currentDateTime
应该为我提供本地时区的日期和时间。
How do I get the DateTimeZone
of currentDateTime
from here? 如何从此处获取currentDateTime
的DateTimeZone
?
调用getZone()
方法:
currentDateTime.getZone()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.