-
Notifications
You must be signed in to change notification settings - Fork 35
[W5][T09-3]Rachel Lim #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| package seedu.addressbook.commands; | ||
|
|
||
| import java.text.SimpleDateFormat; | ||
| import java.util.Date; | ||
|
|
||
| /** | ||
| * Prints date and time at exact moment when user enters "clock" command. | ||
| */ | ||
| public class ClockCommand extends Command { | ||
| public static final String COMMAND_WORD = "clock"; | ||
|
|
||
| public static final String MESSAGE_USAGE = COMMAND_WORD | ||
| + ": Prints date and time in format: day, date-month-year at hr:min:sec AM/PM timezone.\n" | ||
| + "Example: " + COMMAND_WORD; | ||
|
|
||
| @Override | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing header comment. All non-trivial methods should have java doc format header comments. |
||
| public CommandResult execute() { | ||
| Date now = new Date(); | ||
| SimpleDateFormat dateFormatter = new SimpleDateFormat("E, dd-MM-yyyy 'at' hh:mm:ss a z"); | ||
| //System.out.println("Date & Time now: " + dateFormatter.format(now)); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment is not necessary for your program to run, nor does it improve readability of your code. |
||
| return new CommandResult("Date & Time now: " + dateFormatter.format(now)); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the description for your feature? It is missing.