I am trying to convert date/time string to unix timestamp string:
<?php
echo strtotime("20140921040000");
?>
Output: 1411286400 //timestamp
Doing same in GO lang, but not getting desired result. Go code is below:
package main
import (
"fmt"
"time"
)
func main() {
tm := time.Unix(1411286400, 0)
fmt.Println(tm) //output: 2014-09-21 08:00:00 +0000 UTC
//================
layout := "20060102150405"
str := "20140921040000"
t, err := time.Parse(layout, str)
if err != nil {
fmt.Println(err)
}
fmt.Println(t) // output: 2014-09-21 04:00:00 +0000 UTC
}