A quick G$$gle search for: "802.11 beacon frame timestamp"
yields some useful info:http://mrncciew.com/2014/10/08/802-11-mgmt-beacon-frame/
explains the beacon frame fields in some detail but describes the timestamp as "the number of microseconds the AP has been active."
discusses a packet time discrepancy issue but contains the hidden gem :
"pcap gets the time stamp of a packet by mechanisms that return the time in UN*X format i.e. seconds and fractions of a second since January 1, 1970, 00:00:00 UTC"
...oh really??? aha....
Important info seems to be in http://%20http://web.cecs.pdx.edu/~jrb/netsec/lectures/80211/beacon.txt
This analysis of a beacon hex packet lists the EPOCH timestamp in REVERSE BYTE ORDER !!!
ie the beacon packet contains 50f1133cca040000 in the 8 timestamp bytes but the Timestamp is listed as 0x000004CA3C13F150..
...Hmmm... might be useful to know this (!)
The G$$gle hitlist also contains many 802.11 PDFs & the info you need is probably in there somewhere, but I would take the direct approach
Fire up Wireshark (you DO have wireshark??? If not then grab it asap, indispensible for messing about with WLAN programs)
Set the filter to catch beacons packets only & save the packet hex values for a few beacon packets.
Extract the 8 hex bytes from the beacon packet, reverse the byte order & use the awesom EPOCH tools athttp://www.epochconverter.com/
to convert the timestamp bytes back to a real date.
You may need to divide by 1000, or add/remove a timezone offset.... , mess about with offsets... blah blah...
The goal is to first manually discover exactly how to convert the time
Then Forget "C" for the time being... ;^))) & Write a quick conversion program in your favourite high-level language
to extract the 8 hex bytes from the timestamp field of the beacon packet and convert these into a datetime value
Write the C routine once your high-level language version is working.
My only reservation is the reference to ... "the number of microseconds the AP has been active."....
On the surface, this would mean that every AP would return a different timestamp in the beacon packet & you will need to use another timestamp, but the references I have found with my quick searches are all a bit vague.
I would follow the "suck it & see" method, have a quick play with Wireshark on your own WLAN & maybe compare the results
with a few other WLANs..
I hope this helps .... Let me know how you get on