emulator clock time

Put your problem here if it does not fit any of the other categories.

emulator clock time

Postby neel » Mon Mar 17, 2008 6:34 am

hi

whenever i launch the emulator it shows wrong time in the clock(upper right hand corner)

is there a way to set it?

thanks
neel
Developer
Developer
 
Posts: 31
Joined: Fri Feb 15, 2008 5:09 am
Location: San Jose

Top

Postby erbedo » Mon Mar 17, 2008 9:33 am

Sure, you need to use the adb command.
Just type:
$ adb shell date secs

where secs is seconds since 1970-01-01 00:00:00 UTC.
Proudly supporting Android :)
erbedo
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu Mar 13, 2008 9:39 pm

Postby neel » Mon Mar 17, 2008 5:05 pm

thanks for reply

but i am using windows and i cant find any command similar to

Code: Select all
adb shell date secs

for windows
neel
Developer
Developer
 
Posts: 31
Joined: Fri Feb 15, 2008 5:09 am
Location: San Jose

Postby sxjthefirst » Mon Mar 17, 2008 5:22 pm

adb shell is a androit tool should work on any OS where you have Andriod SDK installed.

Go to Command Prompt and type in the command. Your PATH variable should be set or go to the android/tools directory and run adb from there.
sxjthefirst
Developer
Developer
 
Posts: 36
Joined: Wed Mar 12, 2008 7:24 pm

Postby cadlg » Mon Mar 17, 2008 5:24 pm

Hi neel.

"adb" is a tool that comes with the android sdk. It is located in the "tools" directory (for example "C:Program Filesandroid-sdk_m5-rc15_windowstools").

Open a command promt session (executing 'cmd') and then type "adb shell". If you didn't add the tools path to your 'path' environment variable, you will need to navigate to the tools directory first.

This command opens a shell on the emulator, where you can do various things.

Te emulator must be running.

Hope this helps.

cadlg.
cadlg
Experienced Developer
Experienced Developer
 
Posts: 84
Joined: Wed Feb 20, 2008 12:33 am
Location: Guatemala

Postby neel » Mon Mar 17, 2008 6:36 pm

thanks guys

i started the shell prompt (#) by typing :


Code: Select all
C:android-sdk_m5-rc14_windowstools>adb shell
# date
date
Mon Mar 17 17:32:29 GMT 2008
# time
time
time: not found

so now pls tell me how do i set the time for my emulator

please specify what i have to type at teh shell prompt now to set the time
neel
Developer
Developer
 
Posts: 31
Joined: Fri Feb 15, 2008 5:09 am
Location: San Jose

Top

Postby kiran » Tue Mar 18, 2008 7:33 am

hi,

Thats a command used in linux. http://dtmilano.blogspot.com/2008/01/se ... droid.html Has anybody done this in windows.
:) smile it is the key that fits the lock of everybody's heart
User avatar
kiran
Experienced Developer
Experienced Developer
 
Posts: 78
Joined: Thu Nov 22, 2007 11:36 am
Location: India

emulator date/time

Postby cybohemia » Sat Apr 12, 2008 9:51 pm

Hi - was this ever resolved? I'm getting the right time in the adb shell but a different (and wrong) time in my Java code (using the getInstance method from Calendar). Anyone else have this problem? Or, has anyone solved it?

Thanks!

cybohemia
cybohemia
Junior Developer
Junior Developer
 
Posts: 15
Joined: Sun Mar 02, 2008 12:21 am

Postby E.Jyothsna » Mon Apr 21, 2008 7:24 am

by using this command i changed my emulator time.But when i closed my emulator again it showing wrong time.How can i change emulator time permanently.please tell me the solution.
$ adb shell date -s 20080421.115033
E.Jyothsna
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu Feb 28, 2008 12:25 pm
Location: chennai

Postby larryzou » Mon Apr 21, 2008 2:00 pm

Hi dude, that's a GMT time.
For me, I am in timezone GMT+8, it will minus 8. And if you call getDefaultTimeZone() in jdk, you will get GMT+0.
User avatar
larryzou
Freshman
Freshman
 
Posts: 5
Joined: Sun Apr 20, 2008 12:05 pm

Postby michang05 » Thu Oct 23, 2008 4:10 am

yes how do we set it permanently ? i need it for the app that im testing with! thanks
Everybody Lies!
michang05
Junior Developer
Junior Developer
 
Posts: 11
Joined: Mon Sep 29, 2008 11:15 am
Location: Philippines

Postby yxc3998 » Mon Oct 27, 2008 3:52 am

Need to have -timezone <timezone> option with emulator.exe when you launch the emulator.

<timezone> must be specified in zoneinfo format. For example:

"America/Los_Angeles"
"Europe/Paris"
yxc3998
Freshman
Freshman
 
Posts: 4
Joined: Tue Sep 23, 2008 4:04 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 14 guests