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
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started