How can I parse the following timestamp in Go?
date +%y%m%d%H%M%S%N
190207202017034235995
Thanks,
Raj
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-
On Thu, Feb 7, 2019 at 2:28 PM Rajanikanth Jammalamadaka
wrote:
>
> How can I parse the following timestamp in Go?
>
> date +%y%m%d%H%M%S%N
>
> 190207202017034235995
for the ymdHMS part, you can use:
time.Parse("060102150405",str[:12])
I don't know if time parser has something for the %N, you m
Thanks. This is what I had to do as also pointed out by Martin Schnabel:
https://play.golang.org/p/cC3yJ2AWquk
On Thu, Feb 7, 2019 at 7:10 PM Burak Serdar wrote:
> On Thu, Feb 7, 2019 at 2:28 PM Rajanikanth Jammalamadaka
> wrote:
> >
> > How can I parse the following timestamp in Go?
> >
> > da
Le 08/02/2019 à 01:10, Burak Serdar a écrit :
On Thu, Feb 7, 2019 at 2:28 PM Rajanikanth Jammalamadaka
wrote:
How can I parse the following timestamp in Go?
date +%y%m%d%H%M%S%N
190207202017034235995
for the ymdHMS part, you can use:
time.Parse("060102150405",str[:12])
I don't know if time
just for future reference, there is no format for 'this' (the format op
asked for). because this format does not have a period. i was just as
surprised. you can try yourself: https://play.golang.org/p/wv_PDwTmEOk
the documentation also states that you do not specify the fraction
seconds for pa