Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a C++ program called epoch.cpp that uses the system command date to displa

ID: 3919190 • Letter: W

Question

Write a

C++ program called epoch.cpp that uses the system command

date to display the time and date in a specic format. Your C++ program should first

request a Unix epoch (elapsed seconds since 1 Jan 1970) and then invoke the command

date two times. First, to display the time the specied epoch represents in the format

HH:MM:SS and then the date the specied epoch represents in the format Weekday Day

Month Year.

Example output:

user~$ make run

./epoch

Enter unix epoch: 1550000000

21:33:20

Tuesday 12 February 2019

important:

Your program should be using C++ functions like execve() and friends to execute

system commands.

Explanation / Answer

Use gmttime to convert from epoch to date time

Output:

Instead of nullptr in above code use user entered epoch

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote