profile
viewpoint
Gert-Jan Timmer GJRTimmer ENOVATION Zoetermeer, Netherlands

GJRTimmer/docker-postgresql 4

Docker Alpine PostgreSQL

GJRTimmer/docker-alpine-base 2

Alpine Linux base image with S6/Overlay

GJRTimmer/docker-alpine-glibc 1

Docker alpine glibc

GJRTimmer/docker-alpine-sdk 1

Alpine SDK image for building packages

GJRTimmer/docker-alpine-tcl 1

Docker alpine image for building tcl projects

GJRTimmer/docker-gitlab 1

Dockerized GitLab

GJRTimmer/docker-gitlab-cleaner 1

Dockerized Gitlab Cleaner

GJRTimmer/aports 0

Readonly mirror of aports (http://git.alpinelinux.org/cgit/aports)

issue commentmattn/go-sqlite3

Scan cannot convert sqlite datetime to go *time.Time

@mattn Why you can't fix this issue? What if I try to do this and create pull request?

aletheia7

comment created time in 20 hours

created repositoryamoffat/homebrew-rnd

created time in 2 days

fork amoffat/homebrew-core

🍻 Default formulae for the missing package manager for macOS

https://brew.sh

fork in 2 days

push eventKoppeltaal/Koppeltaal-Test-Game

Bart Mehlkop

commit sha 2131b6bef00ee8d200ef4f24b03f9f63a4564124

Fixed security domain not being set after OAuth login.

view details

Bart Mehlkop

commit sha 1b07cf5d7b6c6cff9542f20365eb23b88ac04897

Fixed incorrect assertion. (Id is not required)

view details

Jan Wiebe de Haan

commit sha df40944f66f4c724d43ee01f14286870abb84e24

Fix redirect url to be aware of the current location of the test game.

view details

Bas Grootens

commit sha 2e0bca2c0ccd2765564c21a738cdac82391611c0

Update test.html URL testgame aangepast naar werkende URL

view details

Bas Grootens

commit sha 1911f3431a9d0b3fedc94c36826009509c1105f6

Update oauth-login.html Copy from masterbranch

view details

Bas Grootens

commit sha cb98280a67262785b8638d0aee5aff5f6d285ea7

Update test.html

view details

Bas Grootens

commit sha a3f5880c8ad8ff0a9e945e900e9bc7c987452853

Merge pull request #2 from Koppeltaal/dev Dev

view details

push time in 2 days

PR merged Koppeltaal/Koppeltaal-Test-Game

Dev

Merged dev with master after correcting several URL's

+9 -7

0 comment

3 changed files

Grootens

pr closed time in 2 days

PR opened Koppeltaal/Koppeltaal-Test-Game

Dev

Merged dev with master after correcting several URL's

+9 -7

0 comment

3 changed files

pr created time in 2 days

push eventKoppeltaal/Koppeltaal-Test-Game

Bas Grootens

commit sha cb98280a67262785b8638d0aee5aff5f6d285ea7

Update test.html

view details

push time in 2 days

push eventKoppeltaal/Koppeltaal-Test-Game

Bas Grootens

commit sha 1911f3431a9d0b3fedc94c36826009509c1105f6

Update oauth-login.html Copy from masterbranch

view details

push time in 2 days

push eventKoppeltaal/Koppeltaal-Test-Game

Bas Grootens

commit sha 2e0bca2c0ccd2765564c21a738cdac82391611c0

Update test.html URL testgame aangepast naar werkende URL

view details

push time in 2 days

startedtriggermesh/tm

started time in 3 days

fork sameersbn/homebrew-core

🍻 Default formulae for the missing package manager for macOS

https://brew.sh

fork in 3 days

PublicEvent

created repositorypeholmst/hexagonal-base

Base classes for domain-driven, hexagonal Spring applications

created time in 4 days

startedserrj-sv/lumi.gateway.mgl03

started time in 4 days

issue commentmattn/go-sqlite3

sqlite3 doesn't have datetime/timestamp types

Unfortunately, this is an artifact of Go's driver API. The driver implementation does not get to see what you are trying to scan into. Instead, the driver is supposed to read out a row of data, and the sql package itself does the conversion. This, combined with SQLite's lack of a first-class timestamp type, leads to these sorts of discrepancies. https://golang.org/pkg/database/sql/driver/#Rows

ghost

comment created time in 4 days

issue commentmattn/go-sqlite3

sqlite3 doesn't have datetime/timestamp types

It sure would be cool if it could try and detect what it was trying to scan into (passing in a float) to determine what type to convert instead of a mix of column type hints.

ghost

comment created time in 4 days

issue commentmattn/go-sqlite3

sqlite3 doesn't have datetime/timestamp types

@rittneje Hey Thanks for the reply! This was the first thing I thought I tried but I didn't CAST in the query when I was trying to figure it out. Thanks for the tip!

ghost

comment created time in 4 days

issue commentmattn/go-sqlite3

sqlite3 doesn't have datetime/timestamp types

@tebruno99 Here is one possible solution to your problem.

First, you will want to explicitly cast the column in question to FLOAT. This will circumvent the logic in this library that tries to parse it as a (normal) timestamp. Then scan the column into a Go float64 and convert to a time.Time as per your link. For example:

coreEpoch := time.Date(2001, time.January, 1, 0, 0, 0, 0, time.UTC)

rows, err := db.Query(`SELECT EntryID, CAST(Timestamp AS FLOAT) FROM Entries`)
if err != nil {
	...
}
defer rows.Close()

for rows.Next() {
	var id uint32
	var coreTimestamp float64

	if err := rows.Scan(&id, &coreTimestamp); err != nil {
		...
	}
	timestamp := coreEpoch.Add(time.Duration(coreTimestamp * float64(time.Second)))

	fmt.Printf("%d: %s\n", id, timestamp)
}

if err := rows.Err(); err != nil {
	...
}

Output from your sample data:

1: 2020-11-12 02:11:23.81881792 +0000 UTC 2: 2020-11-12 02:11:23.81881792 +0000 UTC 3: 2014-07-29 18:22:46 +0000 UTC 4: 2014-07-29 18:22:46 +0000 UTC 5: 2020-11-12 02:11:23.81881792 +0000 UTC

ghost

comment created time in 4 days

startedValveSoftware/SteamVR-for-Linux

started time in 5 days

push eventoehf/ipf

Christian Ohr

commit sha fd2f0e7ff9f63d939b70f26bb7fbee7978ffa7f7

Merge branch 'master' of https://github.com/oehf/ipf

view details

Christian Ohr

commit sha 6946ed113c389b5f6a2b687a110179a10e3bc3e4

Merge branch 'master' of https://github.com/oehf/ipf

view details

Christian Ohr

commit sha a7b3d1736252027b6384956ebe6b2eab94340d97

Update versions, remove warnings

view details

push time in 5 days

push eventoehf/ipf

Boris Stanojevic

commit sha bf4bceb0030644766b8e5a8da96d2461a595d9fe

dokka plugin version update

view details

push time in 5 days

push eventoehf/ipf

Boris Stanojevic

commit sha 3955096be89486ee500c30cb974b4df2179d61d4

[maven-release-plugin] prepare for next development iteration

view details

push time in 6 days

created tagoehf/ipf

tagipf-3.7.3

Open eHealth Integration Platform

created time in 6 days

push eventoehf/ipf

Boris Stanojevic

commit sha a8a0b3bdf2a9cb791ec8f04004683531e0f8b403

[maven-release-plugin] prepare release ipf-3.7.3

view details

push time in 6 days

startedAlexxIT/XiaomiGateway3

started time in 6 days

issue commentmattn/go-sqlite3

sqlite3 doesn't have datetime/timestamp types

When reading CoreData sqlite databases a lot of apps tend to write the CFAbsoluteTime which results in a TIMESTAMP field that cannot be converted into a time.Time correctly. The contents being "626839883.818818" for example.

This has left me in a position where I don't seem to be able to get the value out of the DB correctly.

1,"626839883.818818"
2,"626839883.818818"
3,"428350966"
4,"428350966"
5,"626839883.818818"
var PK int64
var mactime string
err = rows.Scan(&PK,&mactime)

This results in mixed values for the string, and failure if you use time.Time Result: (fmt.Printf("%d %s", PK, mactime)

5 6.28350966099928e+08
1 6.26839883818818e+08
2 6.26839883818818e+08
3 1983-07-29T18:22:46Z
4 1983-07-29T18:15:00Z

Do you have any suggestion on how I can get an consistant integer or float out of these databases with go-sqlite3 ?

ghost

comment created time in 7 days

pull request commentmattn/go-sqlite3

sqlite3_test.go: Fix go test -run=...: Use standard sub-tests

Updated patch to reduce redrawing of popupmenu

evanj

comment created time in 11 days

pull request commentmattn/go-sqlite3

sqlite3_test.go: Fix go test -run=...: Use standard sub-tests

Could you please rebase from master ?

evanj

comment created time in 12 days

push eventmattn/go-sqlite3

Yasuhiro Matsumoto

commit sha 223d277c80df7797d0a7fc84bfa813ca780c6cda

Fix ci

view details

push time in 12 days

pull request commentmattn/go-sqlite3

sqlite3_test.go: Fix go test -run=...: Use standard sub-tests

Thank you. But tests seems failing.

evanj

comment created time in 13 days

more