# Puzzle: Beginner Series #2 Clock \[reference\]

**URL:** <https://forum.codeselfstudy.com/t/puzzle-beginner-series-2-clock-reference/2478>\
**Category:** Puzzles and Logic\
**Created:** [November 4, 2020, 8:58am UTC](https://forum.codeselfstudy.com/t/puzzle-beginner-series-2-clock-reference/2478 "2020-11-04T08:58:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![content\_bot](https://forum.codeselfstudy.com/letter_avatar_proxy/v4/letter/c/9d8465/32.png) [@content\_bot](https://forum.codeselfstudy.com/u/content_bot)\
**Post date:** [November 4, 2020, 8:58am UTC](https://forum.codeselfstudy.com/t/puzzle-beginner-series-2-clock-reference/2478/1 "2020-11-04T08:58:34Z")

</div>

“ **Beginner Series #2 Clock** ” is a coding puzzle that people can be attempted in the following languages: csharp, javascript, ruby, java, python, prolog, cfml, c, typescript, julia, swift, solidity, shell, scala, rust, reason, r, purescript, powershell, php, ocaml, objc, nim, lua, kotlin, haskell, groovy, sql, racket, go, nasm, vb, elixir, elm, erlang, fsharp, fortran, crystal, cpp, clojure, factor, forth, dart, coffeescript, haxe, and cobol.

- **Difficulty:** 8 kyu
- **Stars:** 156
- **Votes:** 2659
- **Category:** reference
- **Tags:** Fundamentals
- **Source:** [codewars](https://www.codewars.com/kata/55f9bca8ecaa9eac7100004a)

# Description

Clock shows ‘h’ hours, ‘m’ minutes and ‘s’ seconds after midnight.

Your task is to make ‘Past’ function which returns time converted to milliseconds.

## Example:

```auto
c
past(0, 1, 1) == 61000

```

```auto
javascript
past(0, 1, 1) == 61000

```

```auto
csharp
Past(0, 1, 1) == 61000

```

```auto
python
past(0, 1, 1) == 61000

```

```auto
ruby
past(0, 1, 1) == 61000

```

```auto
java
Past(0, 1, 1) == 61000

```

```auto
prolog
past(0, 1, 1, 61000).

```

```auto
cfml
past(0, 1, 1) == 61000

```

```auto
typescript
past(0, 1, 1) === 61000

```

```auto
coffeescript
past(0, 1, 1) == 61000

```

```auto
julia
past(0, 1, 1) == 61000

```

```auto
clojure
(= (past 0 1 1) 61000)

```

```auto
cpp
past(0, 1, 1) == 61000

```

```auto
crystal
past(0, 1, 1) == 61000

```

```auto
dart
past(0, 1, 1) == 61000

```

```auto
elixir
past(0, 1, 1) == 61000

```

```auto
elm
past 0 1 1 == 61000

```

```auto
erlang
past(0, 1, 1) =:= 61000

```

```auto
factor
0 1 1 past 61000 =

```

```auto
forth
0 1 1 past 61000 =

```

```auto
fortran
past(0, 1, 1) == 61000

```

```auto
fsharp
past 0 1 1 = 61000

```

```auto
go
past(0, 1, 1) == 61000

```

```auto
groovy
past(0, 1, 1) == 61000

```

```auto
haskell
past 0 1 1 == 61000

```

```auto
kotlin
past(0, 1, 1) == 61000

```

```auto
lua
past(0, 1, 1) == 61000

```

```auto
nasm
past(0, 1, 1) == 61000

```

```auto
nim
past(0, 1, 1) == 61000

```

```auto
objc
past(0, 1, 1) == 61000

```

```auto
ocaml
past 0 1 1 == 61000

```

```auto
php
past(0, 1, 1) == 61000

```

```auto
powershell
Past(0, 1, 1) == 61000

```

```auto
purescript
past 0 1 1 == 61000

```

```auto
r
past(0, 1, 1) == 61000

```

```auto
racket
(= (past 0 1 1) 61000)

```

```auto
reason
past(0, 1, 1) == 61000

```

```auto
rust
past(0, 1, 1) == 61000

```

```auto
scala
past(0, 1, 1) == 61000

```

```auto
shell
run_shell(args: [0, 1, 1]) == 61000

```

```auto
solidity
past(0, 1, 1) == 61000

```

```auto
sql
{h: 0, m: 1, s: 1} =&gt; res: 61000

```

```auto
swift
past(0, 1, 1) == 61000

```

```auto
vb
Past(0, 1, 1) == 61000

```

```auto
haxe
past(0, 1, 1) == 61000

```

```auto
cobol
MOVE 0 TO Hours
MOVE 1 TO Minutes
MOVE 1 TO Seconds
PERFORM Past
* Millis = 61000

```

Input constraints: `0 &lt;= h &lt;= 23`, `0 &lt;= m &lt;= 59`, `0 &lt;= s &lt;= 59`

# Solve It Here

Click the link below to solve it on Codewars:

> **[Beginner Series #2 Clock](https://www.codewars.com/kata/55f9bca8ecaa9eac7100004a)**
>
> Clock shows h hours, m minutes and s seconds after midnight. 
> Your task is to write a function which returns the time since midnight in milliseconds. 
> Example: 
> h = 0
> m = 1
> s = 1
> 
> result = 61000...

# Notes

This puzzle was posted by a Slackbot via a slash command. If you want to help work on the app, send a message to @Josh.

If you don’t want to see the coding puzzles when you visit the forum, you can go into [your settings](https://forum.codeselfstudy.com/my/preferences/categories) and mute the puzzles category.

---

<div class="post-metadata">

**Author:** ![Josh](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/josh/32/4_2.png) [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Post date:** [November 4, 2020, 9:23am UTC](https://forum.codeselfstudy.com/t/puzzle-beginner-series-2-clock-reference/2478/2 "2020-11-04T09:23:16Z")

</div>

I did this one in Elixir.
