I'm trying to write suitable method of converting appengine/datastore.Time type to string.
This type is declared as type Time int64
But when i'm trying to use it as int64 value:
localTime := time.SecondsToLocalTime(t/1000)
I'm receiving error message
cannot use t / 1000 (type datastore.Time) as type int64 in function argument
Assignment from int64 to Time typed 开发者_JS百科variable is successfull, but how can i cast it back?
do it like
time.SecondsToLocalTime(int64(t)/1000)
See more in the documentation about Conversions
精彩评论