Android Question same output for DateTime.now

zohar

Member
Licensed User
Longtime User
Hi

each time im running the program with DateTime.now it shows me the same value :2147483647
as far as i understand this is epoch and it represent seconds that passed from a specific date .
why i can't see any changes in the number ?

Thanks ,
Zohar
 

zohar

Member
Licensed User
Longtime User
Hi

each time im running the program with DateTime.now it shows me the same value :2147483647
as far as i understand this is epoch and it represent seconds that passed from a specific date .
why i can't see any changes in the number ?

Thanks ,
Zohar
my mistake ive used int instead of long .

sorry .
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
i cant reproduce it....
LogCat connected to: 9885e6514556383552
--------- beginning of main
--------- beginning of system
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
TimerTick: 1463736897473
TimerTick: 1463736897973
TimerTick: 1463736898474
TimerTick: 1463736898974
TimerTick: 1463736899475
TimerTick: 1463736899976
TimerTick: 1463736900477
TimerTick: 1463736900977
TimerTick: 1463736901479
TimerTick: 1463736901979
TimerTick: 1463736902479
TimerTick: 1463736902979
TimerTick: 1463736903479
TimerTick: 1463736903980
TimerTick: 1463736904480
TimerTick: 1463736904980
TimerTick: 1463736905481
TimerTick: 1463736905981
TimerTick: 1463736906482
TimerTick: 1463736906983
TimerTick: 1463736907484
TimerTick: 1463736907985
TimerTick: 1463736908485
TimerTick: 1463736908986
TimerTick: 1463736909486
TimerTick: 1463736909987
TimerTick: 1463736910488
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
TimerTick: 1463736910988
TimerTick: 1463736911489
TimerTick: 1463736911989
TimerTick: 1463736912490
TimerTick: 1463736912991
TimerTick: 1463736913492
TimerTick: 1463736913992
TimerTick: 1463736914493
TimerTick: 1463736914993
TimerTick: 1463736915494
TimerTick: 1463736915995
TimerTick: 1463736916495
TimerTick: 1463736916996
TimerTick: 1463736917497
TimerTick: 1463736917997
TimerTick: 1463736918498
TimerTick: 1463736918999

B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim t As Timer
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    t.Initialize("Timer",500)
    t.Enabled = True
End Sub
Sub Timer_Tick
    Log("TimerTick: "&DateTime.Now)
End Sub
 
Upvote 0
Top