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

Parsing dont work right, time hopping... #5

Open
Dexus opened this issue Apr 20, 2017 · 3 comments
Open

Parsing dont work right, time hopping... #5

Dexus opened this issue Apr 20, 2017 · 3 comments

Comments

@Dexus
Copy link
Contributor

Dexus commented Apr 20, 2017

ts := timeutils.NewTime(time.Now(), timeutils.TimestampNano)
tts, _ := timeutils.ParseDateString(ts.UTC().String())
tts.String()

the tts.String() Time hopping always around, we have now 11:54 but the output hopping to 12:07, 11:50 etc.

EDIT: Info to system: Alpine Linux (Linux 4.5.7-std-3 x86_64 ); go version go1.8.1 linux/amd64

@Dexus Dexus closed this as completed Apr 20, 2017
@Dexus
Copy link
Contributor Author

Dexus commented Apr 20, 2017

Okay my fault, is a problem of the used parser approxidate...

the microtime is to long for correct parsing with approxidate

edit: microtime = nanotime

@Dexus Dexus reopened this Apr 24, 2017
@elubow
Copy link
Contributor

elubow commented Apr 24, 2017

The issue with trying to parse millis and nanos is that you don't know if it is millis or nanos without it being explicitly stated. Hence the reason we chose millis because it more suited the purpose at the time. Are you asking if I can add a ParseNano function?

@Dexus
Copy link
Contributor Author

Dexus commented Apr 24, 2017

Yes, maybe it would nice to have the function. Because i use this in JSON and get only hopping dates. We have over 40k req/s so we need the exact time for problem reports.

And cause of the given TimestampNano i thought it will also parse it correct.

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

No branches or pull requests

2 participants