Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions basics/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import "basics/defers"
import (
timebasics "basics/time"
)

func main() {

Expand Down Expand Up @@ -57,7 +59,7 @@ func main() {
// defers.DeferUsage()
// defers.SendPanic()
// defers.OutofBound()
defers.RecoverPanic()
// defers.RecoverPanic()

//error_handling.OpenFile()
//error_handling.GetNumber()
Expand All @@ -67,6 +69,8 @@ func main() {
//strings.CreateString()
//strings.StringAdvanced()

timebasics.CallNow()

}

func VariablesFunction() {
Expand Down
16 changes: 16 additions & 0 deletions basics/time/date_and_time.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package timebasics

import (
"fmt"
"time"
)

func CallNow() {
fmt.Println("Now Function: ", time.Now())
fmt.Println("Now Function's converted to UTC: ", time.Now().UTC())
fmt.Println("Now Function's weekday ", time.Now().Weekday())
fmt.Println("Now Function's year: ", time.Now().Year())
fmt.Println("Now Function's day: ", time.Now().Day())
fmt.Println("Now Function's hour: ", time.Now().Hour())

}