There's one big problem with MySQL: MySQL cannot convert negative epoch timestamps (long values) (dates before 1-1-1970).
This creates problems with for example birthdates. But there are workarounds.
This is my workaround - and it shows the proper birthdate when that date is less than 1970...
" club_member.dob " is my table field with the datetime long value...
Above link attempts to explain the issue...
I don't really understand it, but it works.
I hope some smart SQL expert will break down the statement - and define what each section is doing to create the correct result...
Thanks
This creates problems with for example birthdates. But there are workarounds.
This is my workaround - and it shows the proper birthdate when that date is less than 1970...
B4X:
" date_format((DATE_ADD(FROM_UNIXTIME(0), interval club_member.dob / 1000 second)),'%Y-%m-%d') as BIRTHDAY "
Using Unix Timestamps in MySQL Mini-Course
www.epochconverter.com
" club_member.dob " is my table field with the datetime long value...
Above link attempts to explain the issue...
I don't really understand it, but it works.
I hope some smart SQL expert will break down the statement - and define what each section is doing to create the correct result...
Thanks
Last edited: