Thanks Alan, I had found that after posting and am busy digesting it. I think I see now how they convert to UNIX Time and handle the Leap Year, now I need to try and work it back words, add in the BCD conversions and take out the DST portion (we work only with UST/GMT for time stamps). I also note my error in the Epoch being 1979 I see now it is 1970 did I confuse it with the GPS Time? With all the software based clocks I have written over the years, always in BCD, this is the first time I have tried to interact with networks. I didn't realise there were so many conflicting time formats out there. Cheers Chris On 17 February 2012 11:30, wrote: > > HI, > > > > I have the RTCC on my PIC32 running and all is well but I need to > convert from > > POSIX to BCD to set the RTCC and from BDC to POSIX to TimeStamp out > bound data > > packets. As this would be a frequent requirement for most systems that > are > > communicating with networked devices I was surprised that PLIB has no > functions to > > convert between POSIX TIME format and BCD. > > > > Have I overlooked something (I often do with Microchip Documentation) o= r > has any one > > else created such functions and willing to share? > > > > I am not a LINIX or PC person so have never worked with POSIX TIME > format. From what > > I can find in Google it is a 64Bit Int that counts seconds from midnigh= t > on the 1st > > Jan 1979. The PIC32 RTCC counts from 1st Jan 2000, so I need to add or > subtract an > > offset in seconds and do the BCD conversions, But how are leap years > catered for in > > that calculation? > > > > If no one has code for this I would really appreciate some pointers to > help me > > create the functions. > > Microchip came out with an app note recently on converting between their > RTC chip and Linux time. > > Look at http://ww1.microchip.com/downloads/en/AppNotes/01412A.pdf for > further info. > > > -- > Scanned by iCritical. > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .