Brother even blockchain training take you to the actual go case ($) Go time

Source: Internet
Author: User

The go language is the second open source programming language released by Google 2009.

The go language is optimized for programming multi-processor system applications, with go-compiled programs that are comparable to C or C + + code, and are more secure and support parallel processes. Not only can develop the web, can develop the bottom, now know is to use Golang development. The preferred language for blockchain is go, to-Tai Fang, the Super Ledger is based on the go language, and the go language version of the BTCD.

Brother even go full stack and Blockchain training courses Total 22 weeks study duration, divided into 9 learning stages, that is, the main blockchain language-go language development practice, Blockchain backend technology system-go Language high concurrency and server development, go development Zone block chain public chain (blockchain cryptography, distributed programming, Consensus algorithms, basic concepts, Golan Development), Tai Fong and smart contracts and Dapp development, blockchain distributed application development, blockchain system framework development-Super ledger and Blockchain 3.0EOS, go and blockchain interview hardening and advanced enterprise-level project combat.

Go time

Go provides support for time and time. Here are some examples.

Packagemain

Import "FMT"

Import "Time"

Funcmain () {

P:=fmt. Println

Start from getting the current time

Now:=time. Now ()

P (now)

You can provide years, months, days, etc. to create a time. Of course time

Will always be associated with the region, which is the time zone

Then:=time. Date (2009,11,17,20,34,58,651387237,time. UTC)

P (then)

You can get the various components of time

P (then. Year ())

P (then. Month ())

P (then. Day ())

P (then. Hour ())

P (then. Minute ())

P (then. Second ())

P (then. Nanosecond ())

P (then. Location ())

The output day is a few weeks, one of the Monday-sunday

P (then. Weekday ())

The following several methods determine the order of two time, accurate to the second

P (then. Before (now))

P (then. After (now))

P (then. Equal (now))

The Sub method returns two time intervals (Duration)

Diff:=now. Sub (then)

P (diff)

The size of the interval can be calculated in different units

P (diff. Hours ())

P (diff. Minutes ())

P (diff. Seconds ())

P (diff. Nanoseconds ())

You can use the Add method to add an interval to the time

Use a minus sign to indicate that time goes forward a time interval

P (then. Add (diff))

P (then. ADD (-diff))

}

Run results

2014-03-0222:54:40.561698065+0800cst

2009-11-1720:34:58.651387237+0000utc

2009

November

17

20

34

58

651387237

Utc

Tuesday

True

False

False

37578h19m41.910310828s

37578.328308419674

2.2546996985051804e+06

1.3528198191031083e+08

135281981910310828

2014-03-0214:54:40.561698065+0000utc

2005-08-0502:15:16.741076409+0000utc

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.