Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem Statement: Write a program that accepts six input values: year, month, day, hours, minutes, and seconds and prints one value: the UNIX time number

Problem Statement:

Write a program that accepts six input values: year, month, day, hours, minutes, and seconds and prints one value: the UNIX time number ignoring time zones.

Constraints:

Write in the C programing language, do not use system calls, no variables(do not use an assignment statement inside a function, global variables are okay), Inputs are command line parameters.

Requirements:

If the year is less than 1970(prior to the UNIX Epoch), the output should be something like "invalid input, that is before the UNIX epoch", You are NOT required to validate day, month, hour, minute, or second values.

Hints:

Be careful of leap years(leap years are every 4 years, but not every 100 years, except when every 400), don't add a day for a leap year if the date is before March 1, use an array to pre-compute the number of days in a year before a month, don't use Int type for seconds, use functions.

Example:

01:46:40 UTC on Sunday, 9 September 2001 was the Unix billennium(Unix time number 1,000,000,000)

At 23:31:30 UTC on 13 February 2009 the decimal representation of Unix time reached 1,234,567,890 seconds(like the number row on a keyboard)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

clarify the relationship between research, theory and practice;

Answered: 1 week ago

Question

How many multiples of 4 are there between 10 and 250?

Answered: 1 week ago