English 中文(简体)
A. 设法解决格式转换问题
原标题:String to Date format conversion problem
  • 时间:2011-07-13 14:20:23
  •  标签:
  • android

在我看来,当我改写为日期标时,我就改用了科技委的形式(Thu jun 03 10-10 科技促委会2011年),而我却想像太平洋亚洲这样的目前时间区,但我要说的是,我并没有想要改变任何时间区。

Thanks, balu.

最佳回答

采用以下编码。 使用当地语是选择性的,因为它控制着显示日期时所用的语言。 重要的是正确使用时区。 2. 对当地和时地两种不同环境的代码进行跟踪,以了解产出的变化情况。 例如,如果您将当地改为: locale(fr ,FR >。 该方案的产出:13 juillet 2011 08:05:31 PDT,而不是July 13, 2011 8:05:52 AM PDT。 通知说,由于我们没有改变时区,区仍为平地区。

    Locale locale = new Locale("en","US");
    TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");

    Calendar date = Calendar.getInstance(tz,locale);

    DateFormat df = DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG,locale);
    df.setTimeZone(tz);

    System.out.println(df.format(date.getTime()));
问题回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签