使用Joda API转换为CST [英] Convert to CST Using Joda API

查看:102
本文介绍了使用Joda API转换为CST的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道如何使用joda date time apiUTC时间转换为CST时间吗? 我的代码是这样的.

Any one know how to convert UTC time to CST time using joda date time api ? My code is something like this.

DateTimeZone zone = DateTimeZone.forID("CST");
DateTime mstTime = utcDateTime.toDateTime(zone);

Api说无法识别日期时间区ID CST"

Api says 'The datetime zone id CST is not recognised'

推荐答案

诸如"CST"之类的短时区ID不清楚且模棱两可,因此不支持它们.使用更长的格式,例如"America/New_York".

Short time-zone ids like "CST" are unclear and ambiguous, so they are not supported. Use a longer form, like "America/New_York".

这篇关于使用Joda API转换为CST的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆