zoukankan      html  css  js  c++  java
  • 3.4 计算机时间元年

    
    package main
    
    import (
    	"fmt"
    	"time"
    )
    
    func main() {
    
    	// Set the epoch from int64
    	t := time.Unix(0, 0)
    	fmt.Println(t)
    
    	// Get the epoch
    	// from Time instance
    	epoch := t.Unix()
    	fmt.Println(epoch)
    
    	// Current epoch time
    	apochNow := time.Now().Unix()
    	fmt.Printf("Epoch time in seconds: %d
    ", apochNow)
    
    	apochNano := time.Now().UnixNano()
    	fmt.Printf("Epoch time in nano-seconds: %d
    ", apochNano)
    
    }
    
    /*
    1970-01-01 08:00:00 +0800 CST
    0
    Epoch time in seconds: 1521649376
    Epoch time in nano-seconds: 1521649376346176000
    
    */
    
    
  • 相关阅读:
    sed 使用总结
    rgmanager 介绍
    linux nbd & qemu-nbd
    corosync基本使用
    svn 基本使用
    tornado 实践
    mysql mac启动
    postgresql
    django
    django
  • 原文地址:https://www.cnblogs.com/zrdpy/p/8620846.html
Copyright © 2011-2022 走看看