Categories: Python | How To | Code Examples | S60
This page was last modified 10:26, 22 June 2008.
How to set the device's time
From Forum Nokia Wiki
This is how you can set the time on the phone using PyS60.
import e32 e32.set_home_time(target_time_in_Unix_timestamp) #Unix timestamp means seconds since Jan 1 1970 00:00:00
Note: Setting the time this way works on the emulator, but on a real device, you will need special permission, meaning that you will have to sign the application with the capability "WriteDeviceData"
In order to check various time values, you can do something like this:
from time import * print localtime(UnixTS) #Returns a tuple such as (2008, 4, 10, 20, 34, 2, 3, 101, 1), #corrsponding to the value of UnixTS (optional parameter) #If no parameter is specified, it returns the current date and time print mktime(localtime()) #Returns the corresponding unix timestamp, in this case 1207848751.0
More information about the time module can be found here
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Changing time | schattenangst | Mobile Java General | 1 | 2002-12-09 06:53 |
| Http Post (Time Out Error ) | Mdhaval | General Symbian C++ | 0 | 2005-06-09 15:12 |
| How to Set And Get the data in dailogquery | sriramadasu | General Symbian C++ | 7 | 2006-12-20 07:04 |
| 7650 Bluetooth | Pile | General Discussion | 3 | 2003-04-07 10:16 |
| SDKs Selection | shashidon | General Symbian C++ | 3 | 2008-02-01 10:07 |
