Skip to content

Commit

Permalink
fixed the add and subtract methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tacheraSasi committed Nov 24, 2024
1 parent b62d9ad commit 6d27e63
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions module/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ func init() {
TimeFunctions["since"] = since
TimeFunctions["format"] = format
TimeFunctions["isLeapYear"] = isLeapYear
TimeFunctions["add"] = add
TimeFunctions["subtract"] = subtract
}

func now(args []object.Object, defs map[string]object.Object) object.Object {
Expand Down
2 changes: 2 additions & 0 deletions vintLang/main.vint
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ let greet = func(nameParam) {
year = 2024
print("Is",year,"Leap year:",time.isLeapYear(year))
print(time.format(time.now(), "02-01-2006 15:04:05"))
print(time.add(time.now(), "1h"))
print(time.subtract(time.now(), "2h30m45s"))

// Call the greet function with a sample name
greet("John")
Expand Down

0 comments on commit 6d27e63

Please sign in to comment.