在Go中以字符串形式返回格式化日期

I want to return the current time in a format in go, I have no trouble in format the time, but when return it as string in a func, I got stucked:

package main

import (
    "fmt"
    "time"
)

func getCurrentTime()string{
    t := time.Now().Local()
    return fmt.Sprintf("%s", t.Format("2006-01-02 15:04:05 +0800"))
}

func main() {
    fmt.Println("current Time is:",getCurrentTime)
    t := time.Now().Local()
    fmt.Println("current Time is:", t.Format("2006-01-02 15:04:05 +0800"))
}

The out put is :

current Time is: 0x400c00
current Time is: 2015-01-16 12:45:33 +0800

instead of

current Time is: 2015-01-16 12:45:33 +0800
current Time is: 2015-01-16 12:45:33 +0800

which I expected.

In you main function, you should use getCurrentTime() instead of getCurrentTime. Like this:

fmt.Println("current Time is:", getCurrentTime())

When you pass a function name as the parameter, you are not calling it, the address of the function is actually printed.