From 727b5701327a7e1c5f826f496b8e99c2004e471a Mon Sep 17 00:00:00 2001 From: KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> Date: Wed, 18 Aug 2021 17:34:12 -0300 Subject: experimental type change for times: string to time.Time idk what i was doing before this but i wanted to use time.Time to get something similar to how 4chan's timestamps work, it would've also been easier for scripts to interface with it, since we have data we can work with much easier than a string i am not sure what this means for federation yet, so i'll test it out before i do anything. --- main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index dd73510..6c3e9b7 100644 --- a/main.go +++ b/main.go @@ -1640,8 +1640,8 @@ func CreateObject(objType string) ObjectBase { var nObj ObjectBase nObj.Type = objType - nObj.Published = time.Now().UTC().Format(time.RFC3339) - nObj.Updated = time.Now().UTC().Format(time.RFC3339) + nObj.Published = time.Now().UTC() + nObj.Updated = time.Now().UTC() return nObj } @@ -1780,7 +1780,7 @@ func CreateAttachmentObject(file multipart.File, header *multipart.FileHeader) ( image.Href = Domain + "/" + tempFile.Name() image.MediaType = contentType image.Size = size - image.Published = time.Now().UTC().Format(time.RFC3339) + image.Published = time.Now().UTC() nAttachment = append(nAttachment, image) @@ -1812,7 +1812,7 @@ func ParseCommentForReplies(db *sql.DB, comment string, op string) []ObjectBase if isValid { var reply = new(ObjectBase) reply.Id = links[i] - reply.Published = time.Now().UTC().Format(time.RFC3339) + reply.Published = time.Now().UTC() validLinks = append(validLinks, *reply) } } @@ -2397,7 +2397,7 @@ func ResizeAttachmentToPreview(db *sql.DB) { var mediatype string var name string var size int - var published string + var published time.Time rows.Scan(&id, &href, &mediatype, &name, &size, &published) -- cgit v1.2.3