Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable millisecond timestamp to date #339

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mxlxm
Copy link
Contributor

@mxlxm mxlxm commented May 29, 2019

Enable millisecond timestamp to date

@@ -512,7 +513,11 @@ func (r *River) getFieldValue(col *schema.TableColumn, fieldType string, value i
v := reflect.ValueOf(value)
switch v.Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
fieldValue = r.makeReqColumnData(col, time.Unix(v.Int(), 0).Format(mysql.TimeFormat))
if v.Int() > math.MaxInt32 {
fieldValue = r.makeReqColumnData(col, time.Unix(0, int64(time.Millisecond)*v.Int()).Format(mysql.TimeFormat))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reference that we can know here using millisecond but not second?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated within README.md.
we saved create_time's millisecond timestamp as bigint in mysql.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants