vc-programmer
2008-03-28 22:51:00 UTC
hello all,
for my small program, i i want to get the date and time in UTC . there are
two issues i am running into:
1> i referred to http://www.abnormal.com/~thogard/ntp/ntpdate.c . i am not
sure how to convert the response from the ntp server ( tmit ? ) into
something like "03/28/2008" and "18:30 PM" ? i know about the unix epoch, but
am lost from the point of "tmit-= 2208988800U;" . ( i also read
http://en.wikipedia.org/wiki/Unix_time but am clear as mud) .
2> when i am running the program on a network which has a firewall blocking
communication on port 123, i dont get any error in sendto and recv ( no
SOCKET_ERROR ), i only get a "first time exception" inside the debugging
window. how should i be handling this exception?
thanks for any comments and suggestions you can provide.
vc-programmer
for my small program, i i want to get the date and time in UTC . there are
two issues i am running into:
1> i referred to http://www.abnormal.com/~thogard/ntp/ntpdate.c . i am not
sure how to convert the response from the ntp server ( tmit ? ) into
something like "03/28/2008" and "18:30 PM" ? i know about the unix epoch, but
am lost from the point of "tmit-= 2208988800U;" . ( i also read
http://en.wikipedia.org/wiki/Unix_time but am clear as mud) .
2> when i am running the program on a network which has a firewall blocking
communication on port 123, i dont get any error in sendto and recv ( no
SOCKET_ERROR ), i only get a "first time exception" inside the debugging
window. how should i be handling this exception?
thanks for any comments and suggestions you can provide.
vc-programmer