获取原始模式字符串给定JDK 8 DateTimeFormatter? [英] Get original pattern String given a JDK 8 DateTimeFormatter?

查看:74
本文介绍了获取原始模式字符串给定JDK 8 DateTimeFormatter?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

相关这里我的问题 - 我该怎么办得到原始图案字符串给予 DateTimeFormatter

Related to my question here - how do I get the original pattern String given a DateTimeFormatter?

推荐答案

它被要求在邮件列表上,答案是不可能,因为原始模式不会被保留。

It's been asked on the mailing list and the answer is that it is not possible because the original pattern is not retained.

相同的主题建议使用 DateTimeFormatterBuilder 确实有这些信息。

The same thread suggests using a DateTimeFormatterBuilder which does have the information.

这篇关于获取原始模式字符串给定JDK 8 DateTimeFormatter?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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