Android Question How Set system Date

mikisquiti

Member
Licensed User
Longtime User
Hello, I have executed this below code but the date of system dont change; pls help me; Miki

Sub SetDateTime(ToDate As String, ToTime As String)
'date needs to be in yyyymmdd format
'time needs to be in hhmmss 24-hour
'date -s 20120419.024012; \n
Dim Command, Runner As String
Dim StdOut, StdErr As StringBuilder
Dim Result As Int
Dim Ph As Phone
StdOut.Initialize
StdErr.Initialize
Runner = File.Combine(File.DirInternalCache, "runner")
Command = File.Combine(File.DirInternalCache, "command")
File.WriteString(File.DirInternalCache, "runner", "su < " & Command)
File.WriteString(File.DirInternalCache, "command", "date -s " & ToDate & "." & ToTime & "; \n" & CRLF & "exit")
Result = Ph.Shell("sh", Array As String(Runner), StdOut, StdErr)
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
Hello, I have executed this below code but the date of system dont change
as you are using SU in the code it will only work on ROOTED devices!
 
Upvote 0

mikisquiti

Member
Licensed User
Longtime User
I know very small thinks about ROOTED, could you tell me how rotate my tablet? my tablet is a chinise model. thanks
 
Upvote 0
Top