Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ferhat tamer
go time
Commits
f69012f9
Commit
f69012f9
authored
Aug 10, 2022
by
ferhat tamer
💬
Browse files
time go
parents
Changes
1
Show whitespace changes
Inline
Side-by-side
time.go
0 → 100644
View file @
f69012f9
package
main
import
(
"fmt"
"time"
)
func
main
()
{
p
:=
fmt
.
Println
now
:=
time
.
Now
()
p
(
now
)
then
:=
time
.
Date
(
2009
,
11
,
17
,
20
,
34
,
58
,
651387237
,
time
.
UTC
)
p
(
then
)
p
(
then
.
Year
())
p
(
then
.
Month
())
p
(
then
.
Day
())
p
(
then
.
Hour
())
p
(
then
.
Minute
())
p
(
then
.
Second
())
p
(
then
.
Nanosecond
())
p
(
then
.
Location
())
p
(
then
.
Weekday
())
p
(
then
.
Before
(
now
))
p
(
then
.
After
(
now
))
p
(
then
.
Equal
(
now
))
diff
:=
now
.
Sub
(
then
)
p
(
diff
)
p
(
diff
.
Hours
())
p
(
diff
.
Minutes
())
p
(
diff
.
Seconds
())
p
(
diff
.
Nanoseconds
())
p
(
then
.
Add
(
diff
))
p
(
then
.
Add
(
-
diff
))
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment