See https://golang.org/pkg/time/#Time.Format

Here's how to use it. I think this is exactly what you want:
https://play.golang.org/p/3r0TFtOmtqF

On Wed, Sep 23, 2020 at 11:43 AM Alex Mills <a...@channelmeter.com> wrote:

> My guess, is that a starting place would be something like:
>
>
> *var s = time.Now().UTC().String()[0:24]*
>
> an example of which looks like:
>
> "2020-09-23 18:41:43.1568"
>
> so I guess I just to know if there is a reliable way to parse that string
> back into a date using multiple programming languages.
>
>
>
> On Wednesday, September 23, 2020 at 11:39:08 AM UTC-7 Alex Mills wrote:
>
>> I have this date string:
>>
>> "2020-09-23 18:31:41.015852841 +0000 UTC"
>>
>> the above is generated via:
>>
>>
>> *time.Now().UTC().String()*
>>
>> my question is, how can I generate a date string like this:
>>
>> "2020-09-23 18:31:41.0158"
>>
>> and how can I then parse it?  I dont need to indicate that it's UTC, I
>> can *assume* it's UTC.
>> But I want to include 4 decimal points.  1 digit more granular than
>> milliseconds, whatever that's called (trivia!).
>>
>> -alex
>>
>>
>>
>>
>>
>> --
> 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-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/5aa0fbde-fc12-4e9a-a5bf-a8a1d8a76b76n%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/5aa0fbde-fc12-4e9a-a5bf-a8a1d8a76b76n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bv29Lv1DX92bWD8rQOQEYCxobUMHAsEtgGYDKpCGGUDzVHL%2BQ%40mail.gmail.com.

Reply via email to