B4J Code Snippet MySQL Negative Dates - Long DateTime (such as Birthdays) problem - Harris    
Jan 21, 2022There'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...
" date_format((DATE_ADD(FROM_UNIXTIME(0), interval club_member.dob / 1000 second)),'%Y... to explain the issue...
I don't really understand it, but it works.
I hope some smart SQL...
B4A Code Snippet [SQL] Convert DateTimeString "dd.mm.YYYY HH:MM" to Android DateTimeLongValue - fredo    
May 10, 2019   
(4 reactions)Code to convert a given DateTimeString in "dd.mm.YYYY HH:MM" format within an SQLite statement to an Android LongValue in ms.
strftime('%s', substr(estart,7,4)||'-'||substr(estart,4,2)||'-'||substr(estart,1,2)||' '||substr(estart,12,5), 'utc') *1000 AS xLongValueFromGivenDateString
While B4X provides sufficient DateTime functions for use in B4X code, it may be necessary to convert externally generated timestamps to the Android format...
B4J Question [Solved] MySQL DATE datatype leads to wrong date? - udg    
Jan 20, 2017Hi all,
today I observed a surprising event.
A field in a MySQL DB is set as DATE datatype. If...-dd"
Dim ddn As String = DateTime.Date(NUser.Get("ddn"))
Dim sql1 As SQL = pool...
link: command.
Edit: I set the TZ=0 in my client, trasmitted the date as a long var, set TZ=0 in the server...
link: As I remeber the Long date is in UTC tz ... so maybe the change happens when you are parsing...
link: I was suspecting TZ too, but my surprise is due to the kind of datatype, a DATE (btw...
B4A Question SQL Date Selection - Pelky (first post)    
Jan 18, 2024Thank you Chris. I realise where I have gone wrong so beside using a large booted foot to kick myse...
link: You can use a Text data type to store datetimes in SQLite if you prefer, but you need to use an ISO8...
link: date...not very clever
I am working on a fix at the moment and I am sure it will work..basically...
link: Are you storing LogDate as Integer in SQLite?...
B4J Question String toSQL DateTime formatDim Unit As String Dim Weight, Height, Target, BMI, BMIa, BMIb As Int Dim Hft, Hin, Wst, Wlbs, Tst, Tlb As Int Unit = s - aeric (first post)    
Jul 27, 2020
I believe it's something to do with the 'bind_param("sss"' because I changed ...
link: If the date and time is based on insert, what I normally do is set the column as timestamp and...
link: As JavaObject
Dim JSQL As SQL
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm...
link:
the field _sfm_form_submision_time_ contains the date, and I thought it was this that was causing...
B4A Question [RESOLVED] jdbcSQL date Value '0000-00-00' can not be represented - sigster (first post)    
Jul 3, 2020Thanks
this works...
link: Nulls and strings don't go well together.
If the above suggestion hasn't solved the issue t...
link: I think this caused by JDBC, add zeroDateTimeBehavior=convertToNull at the end of the jdbc...
link: Hi
I am using jdbcSQL and mysql
when I try to get date I get this error
(SQLException) java.sql...
B4J Question Issue retrieving SQL Server DateTime2 column at change of clocks (GMT to BST) - Chris2 (first post)    
Apr 6, 2022
You may find a solution to your query problem at SQL Server JDBC Driver Date/Timezone Related... with access to SQL Server to confirm/verify the issue....
link: You may find a solution to your query problem at SQL Server JDBC Driver Date/Timezone Related Query...
link:
An example is to choose a reference time for recording that does not use summer and winter time and...
link: . As a result, two identical date and time formats still represent two different "real" time...
B4J Question MySQL Date conversion - Adrian Trantino (first post)    
Jul 31, 2018
DateTime.DateFormat="yyyy-MM-dd HH:mm:ss"
Dim MySqlDate As String=DateTime.Date(Value)
Log(MySqlDate)
DateTime.DateFormat=CurrentFormat
End Sub
Worked a treat thanks again :-)...
link:
DateTime.DateFormat="yyyy-MM-dd HH:mm:ss"
Dim MySqlDate As String=DateTime.Date...
link: the date in MySql as ticks, you get free of any trouble. But I prefer a string.
Thanks Marcick.
I am...
link: the date in MySql as ticks, you get free of any trouble. But I prefer a string....
B4J Question jRDC2, retrieve SQL Server DateTime2 as UTC - OliverA (first post)    
Apr 3, 2021   
(1 reaction)
Dim SQLTime As JavaObject = jrs.RunMethodJO(DateTimeMethods.Get(ct), Array(i + 1, tz.RunMethod... method, forcing it to calculate the incoming (from the DB) date as UTC. I'm glad you figured out my...
link: . Anyway....
Dim SQLTime As JavaObject = jrs.RunMethodJO(DateTimeMethods.Get(ct), Array(i + 1, tz...
link:
...with a possible solution using LocalDateTime...
Actually, why don't you try...
link:
Which I think means that getTimestamp is being inconsistent doesn't it?
The question now is wh...
B4A Question How to format a sql-server date column with jSql library - khaleel (first post)    
Dec 19, 2016Great !!
this will do the job.
thank you , KMatle....
link: Put it in a string and then use SubString2 to get the date and the time. You can then use DateTime...
link: I have an Sql-server databse with some table containing date column.
I use jSql library to connect...
Page: 1  
2  
3  
4  
5