B4J Question datetime from mysql

TomDuncan

Active Member
Licensed User
Longtime User
Hi All,
I have a field in a mysql table which gives the result like "1517191800"
How can I display this as the correct time. (Around 1pm on 29th Jan 2018)
Timezone is +11 hrs (10 + daylightsaving) (Hobart, Australia)
Tom
 
Last edited:

Roycefer

Well-Known Member
Licensed User
Longtime User
In B4J:
B4X:
Dim t As Long = YourVal  'YourVal is the result from the table
Log($"$DateTime{t*1000}"$)

In SQL, you can use the DATETIME method:
B4X:
SELECT DATETIME(fieldname, 'unixepoch','localtime') FROM tablename WHERE blah blah blah
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…