Will Day of Week instead of Day of Month convert to unix format ?

The date is given in 16-bit modbus register as follows:

Bits  0  -  2            Day of Week (Sun = 0, Mon = 1,  ....   Sat  =  6)
Bits  3  -  6            Month of Year (1 -  12)      
Bits  7  -  9            Week of Month (1 - 4)

If I put this date in tm struct format and call mktime().  Will mktime() return
date in unix format ?  

Another words, if I construct tm struct with only Day of Week, Month of Year, and Week of Month, and call mktime(), will I get date in unix format  ?
LVL 1
naseeamAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkrCommented:
In this case, the values should not be sufficiant to create a 'time_t' - 'day of week' would be enough along with 'week of month' and 'month of year' if there was a year specified, but not given that part of the information, the data is ambiguous. If you know waht year to spcify however, everything is fine.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sarabandeCommented:
'week of month' is not a member of struct tm.

i tried tm_year + tm_yday which sould be sufficient. but mktime returned -1 and errno was set to 22 (ERROR_BAD_COMMAND).

so as far i could find out you need day-of-month, month and year for converting a struct tm to time_t.

Sara
0
sarabandeCommented:
'day of week' would be enough along with 'week of month' and 'month of year' if there was a year specified
If you know waht year to spcify however, everything is fine.

both these statements are wrong. the answer should not be the accepted answer.

Sara
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.