Skip to content

Commit 8ef37a7

Browse files
authored
Merge pull request #62 from PRO100BYTE/update-time-command
Update time command
2 parents 45f162d + cf56fc4 commit 8ef37a7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/commands/General/time.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import dateFormat from "dateformat";
2-
const date = new Date();
3-
const t = dateFormat(date, "HH:MM:ss.L");
42

53
export default class TimeCommand {
64
execute(term, params, directory, setDirectory) {
5+
const date = new Date();
6+
const t = dateFormat(date, "HH:MM:ss.L");
77
term.writeln('');
88
term.writeln(`Current time is ${t}`);
99
term.writeln('');
@@ -12,4 +12,9 @@ export default class TimeCommand {
1212
description() {
1313
return "Print current time";
1414
}
15-
}
15+
16+
help(term) {
17+
term.writeln("Usage: time");
18+
term.writeln("This command prints the current time in the format HH:mm:ss.SSS");
19+
}
20+
}

0 commit comments

Comments
 (0)