如何提取从全日的日期字符串短日期? [英] how to extract short date from a full date date string?

查看:149
本文介绍了如何提取从全日的日期字符串短日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到来自web服务日期

i am getting date from webservice

例如:
星期三,2011年6月29日7时13分33秒。

example: Wed, 29 june 2011 07:13:33

现在我不希望显示完整的日期与时间带刚的周三,2011年6月29日
任何一个指导我如何实现这一目标?

now i dont want to show full date with time zone just Wed, 29 june 2011 any one guide me how to achieve this?

任何帮助将是AP preciated。

any help would be appreciated.

推荐答案

这个问题已经解决了在计算器上的位置:的 Java字符串到日期转换
(即日期字符串转换为Java的日期)

This problem was already solved on StackOverflow here: Java string to date conversion (that is converting date string to java date)

下面是您例如:

String inDate="Wed, 29 june 2011 07:13:33";
    Date date;
    try {
        date = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss", Locale.ENGLISH).parse(inDate);
        System.out.println(date); //Wed Jun 29 07:13:33 CEST 2011
    } catch (ParseException e) {
        e.printStackTrace();
    }

打印过时本身应该是至少你的问题

Printing out date itself should be the least of your problems

这篇关于如何提取从全日的日期字符串短日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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