Skip to content

Commit

Permalink
Merge pull request #62 from PRO100BYTE/update-time-command
Browse files Browse the repository at this point in the history
Update time command
  • Loading branch information
mraliscoder authored Nov 26, 2023
2 parents 45f162d + cf56fc4 commit 8ef37a7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/commands/General/time.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import dateFormat from "dateformat";
const date = new Date();
const t = dateFormat(date, "HH:MM:ss.L");

export default class TimeCommand {
execute(term, params, directory, setDirectory) {
const date = new Date();
const t = dateFormat(date, "HH:MM:ss.L");
term.writeln('');
term.writeln(`Current time is ${t}`);
term.writeln('');
Expand All @@ -12,4 +12,9 @@ export default class TimeCommand {
description() {
return "Print current time";
}
}

help(term) {
term.writeln("Usage: time");
term.writeln("This command prints the current time in the format HH:mm:ss.SSS");
}
}

0 comments on commit 8ef37a7

Please sign in to comment.