Date Time di Go Language (GoLang)

Cara mengakses Tanggal dan Waktu menggunakan GoLanguage, contohnya jika kita ingin memasukkan tanggal secara otomatis ke dalam database atau yang lainnya dalam jangka waktu tertentu maka dapat mengikuti code berikut ini(semoga bermanfaat):

package main

import (
       "fmt"
       "time"
)

func main() {
       for i:=0;i<368;i++ {
              t := time.Date(2016, 1, 1, 0, 0, 0, 0, time.Now().Location())
              t = t.AddDate(0, 0, i)
              fmt.Println(t)
       }
}

Posted on 9 February, 2016, in Go Language. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: