Hard C programming Question.

Recommended Videos
Jul 5, 2009
1,342
0
0
I've just been given a question in a programing tutorial that we are not expected to be able to answer but I'd love to learn how so I'm hoping you guys can give me a hand.

What we have to do is give a time here and Ireland that will then be changed into three other time zones with our program.
But I have no idea how to do this.
I know how to use If/else statements, switches, basic loops and just beginner stuff.

Any C wizards who can help this n00b?
 

Phishfood

New member
Jul 21, 2009
742
0
0
Its been far too long since I did C, but that doesn't sound too hard.

Roughly speaking:

1) Retrieve system time

time_t t;
time(&t);

2) split t into its parts
3) modify the hour part for timezone.