No matter what I try printtime ends up being the same as UTC.Įdit 11-29-2013: based on the very helpful answer by "R" below I finally got around to create a working example. 25544 NORAD satellite number of ISS in the TLE 06:14:17.525184 The epoch of the TLE 525184.0 the microseconds of the epoch 66.7566 TLE Mean Anomaly - of ISS at epoch 2457418. The time system is assumed here to be UTC, but no formal documentation exists and UTC, as currently defined, was only introduced in 1972. I thought that the Unix epoch was already in UTC, but if so, why does calling ToUniversalTime () on it change its value. Or strptime(datetime, "%A %B %d %Y %H %M %S", tp) (The difference between UTC and UT1 is always less than a second.) They say: Time accounting within SGP4 is referenced to the epoch of the TLE data. Strftime(printtime, strlen(datetime), "%A %B %d %Y %H %M %S", tp) I have tried a number of variations, such as (datetime is a string with time and date in UTC): strptime(datetime, "%A %B %d %Y %H %M %S", tp) I have read the following links carefully but I can't find a solution there:Ĭonverting string containing localtime into UTC in CĬonverting Between Local Times and GMT/UTC in C/C++ I am looking for a solution in C that's standard and more or less guaranteed to work on any computer at any location. I would like to know how to convert from UTC to local time. It's a simple question, but the solution appears to be far from simple.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |