Android :: Display UTC Date / Time According To The Current Time - Zone

Nov 1, 2010

I am getting a date/time string from web in the format of "yyyy/mm/dd'T'HH:MM:SS'Z'" and it is in UTC. Now i have to identify the current time zone of device and then convert this time to my local time. (FYI, Currently, UTC time is 10:25 AM, in india current time is 3:55 PM)

I know I can use android.text.format.DateFormat.getDateFormat() to format my dates, and android.text.format.DateFormat.getTimeFormat to format my times, but how do I format a datetime? Similar to the getDateTimeInstance method from java.text.DateFormat. I'm currently just concatenating the result of both the getDateFormat and getTimeFormat's formatters, but I don't know which way around the user prefers to have their dates and times shown.

Is there any android widget that enable to pick the date and the time at the same time ? I already use the basic date picker and date picker:http://developer.android.com/guide/tutorials/views/hello-timepicker.htmlhttp://developer.android.com/guide/tutorials/views/hello-datepicker.htmlbut they are not that sexy and user friendly (I found). Do you know if a widget including both date and time exists? Thanks a lot,WW.

I want to develop a game, so I need to know elapsed time at lots places in my game. For example, to measuring FPS. I see there is some example use "System.currentTimeMillis" to measure elapsed time. But I see the warning on document: http://developer.android.com/intl/zh-TW/reference/java/lang/System.ht... "This method shouldn't be used for measuring timeouts or other elapsed time measurements, as changing the system time can affect the results." So, if this method should not be used for measuring elapsed time, then what will be suitable?

After activating the phone, it displayed the correct date and time for my time zone, so I didn't mess around with settings to reset the time, as I would with any other device.

However, I've noticed that the time changes to exactly an hour ahead, before changing itself back several minutes later.

I went to settings > date and time, but 24 hour time and selecting a date format are the only options listed.

I prefer to leave mobile data off when I am at home and can use the wi-fi. Is it necessary to have mobile data turned on, so the phone can receive the time from a cell tower, or is there a way I can set an internal clock?

I travel each week to Brussels from the UK and don't want to keep switching my current time zone.I have tried setting 'Automatic' in the Time & Date settings but it does not seem to do anything, but maybe this is because I have data disabled (cos I don't have a data pack).Is there an App that will use GPS to automatically alter the time zone setting?

My Google Calendar on my Android phone is off by one hour. Although it displays correctly on the website, on my Android phone some of the times are off by 1 hour. When I click into the event, it says (America/Cancun) which I assume means for some reason its displaying Cancun time zone.

For some reason on most mornings since I got my Desire some 12 days ago I get a notification stating that the phone has been unable to confirm my time zone. I get an option to confirm my time zone as BST (GMT +1) and the phone is happy again...until the next morning.

My settings have the phone automatically checking the date and time. The greyed-out "choose time zone" option correctly shows GMT +1 / BST. I switch my phone to airplane mode overnight, so that I don't download updates unnecessarily...and don't get my sleep disturbed. Could this be the problem?

The strange thing is that this has not happened every morning, although most mornings it has. But my brother who lives in the same house also has a Desire and he has rarely had this problem. Any ideas?

I have multiple events (ie birthdays) as all day events. That means that these are set up in Outlook 2007 from 12am to 12pm on selected day. Recently, I went from Central to Eastern time zone. While there, I synced my phone with outlook using HTC Sync and now I have an additional occurrence of the event that goes from 11am to 11pm and spans into the previous day. I thought this would fix itself once the phone was back in the right time zone and was resynced, but it doesn't.

I entered some appointments prior to a business trip in another time zone. When I arrived in the new TZ, the calendar shifted all my appointments by 6 hours, so a 9am meeting was shown at 3am. How can I set an appointment at what will be the local time for that event and not allow the calendar to adjust it?

I've used XDA many times before, normally for specific questions on ARHD ROMs.

I work on a cruise ship and we're continually crossing time zones. Currently, to alter the time zone on my (rooted) HTC OneX, I need to pull down the notifications tray, select settings, scroll down and select date and time, then select time zone. I can't use the Auto function, as the network time on the ship (satellite) is only available over Wi-Fi, for which I have to pay an exorbitant rate.

I'm looking for an app that will allow me one-tap access to changing the time zone. 'Time Zone Widget Light' almost does the job, as a tap on the widget scrolls through pre-set time zones, but this only allows me to step forward, and sometimes I need to go backwards as well (sadly our ship itineraries refuse to follow pre-set time zones, although I'm working on it!)

Any app, or perhaps a toolkit that lets me drill down to sub-layers of the android settings menu and create a short-cut?

If you live in the Eastern time zone, please participate in this poll and indicate whether you have received the D118 update yet OTA (over the air). If you downloaded and installed the update yourself, please do not participate in this poll. This poll is designed to determine the penetration in the Eastern part of the United States. If you indicate NO and leter get the update, please come back and change your response (hopefully vBullitain supports that).

Newbie here. I am very serious about getting the new Spring hero. As an airline pilot traveling outside the US I have a question as to the GPS function. When I turn on the phone in another country to use the GPS function how do I update the date and time and approx location so the gps knows what sats to look for? If I don't have phone/network coverage, and I probably won't how will or update?

I'm looking for an app that lets me quickly insert the time and date in notes - Evernote, Docs to Go etc. I've tried Inserty but that was too cumbersome. Just want something I can tap on and hey presto, current time & date is entered. Any suggestions?

As you know, i can use System.currentTimeMillis() to fetch current local time, but how to convert local time to UTC time? the code below, i can get the timezone, utc_bias also can be got

..............

my problem is i can't determine how to use this utc_bias: added or minus to current local time to get UTC time? You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscribe@googlegroups.com For more options,

I'm just trying to find the way to get current time. But I don't want to use currentTimeMillis() method, because the current time on device may be wrong. Is there any way to make some request to the Internet to get right current time?