Time library synced with gps trouble

I have parallex gps chip, that I wanted to use with the new Time library. I'm also using TinyGPS in another project which works to display coordinates. So I thought it would simple to try out an example provided with the library, but no luck : (
I did not modify anything in the library..

/*
 * TimeGPS.pde
 * example code illustrating time synced from a GPS
 * 
 */

#include <Time.h>
#include <TinyGPS.h>       //http://arduiniana.org/libraries/TinyGPS/
#include <NewSoftSerial.h>  //http://arduiniana.org/libraries/newsoftserial/
// GPS and NewSoftSerial libraries are the work of Mikal Hart

TinyGPS gps; 
NewSoftSerial serial_gps =  NewSoftSerial(3, 2);  // receive on pin 3

const int offset = 1;   // offset hours from gps time (UTC)
time_t prevDisplay = 0; // when the digital clock was displayed

void setup()
{
  Serial.begin(9600);
  serial_gps.begin(4800);
  Serial.println("Waiting for GPS time ... ");
  setSyncProvider(gpsTimeSync);
}

void loop()
{
  while (serial_gps.available()) 
  {
    gps.encode(serial_gps.read()); // process gps messages
  }
  if(timeStatus()!= timeNotSet) 
  {
     if( now() != prevDisplay) //update the display only if the time has changed
     {
       prevDisplay = now();
       digitalClockDisplay();  
     }
  }       
}

void digitalClockDisplay(){
  // digital clock display of the time
  Serial.print(hour());
  printDigits(minute());
  printDigits(second());
  Serial.print(" ");
  Serial.print(day());
  Serial.print(" ");
  Serial.print(month());
  Serial.print(" ");
  Serial.print(year()); 
  Serial.println(); 
}

void printDigits(int digits){
  // utility function for digital clock display: prints preceding colon and leading 0
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
}

time_t gpsTimeSync(){
  //  returns time if avail from gps, else returns 0
  unsigned long fix_age = 0 ;
  gps.get_datetime(NULL,NULL, &fix_age);
  unsigned long time_since_last_fix;
  if(fix_age < 1000)
    return gpsTimeToArduinoTime(); // return time only if updated recently by gps  
  return 0;
}

time_t gpsTimeToArduinoTime(){
  // returns time_t from gps date and time with the given offset hours
  tmElements_t tm;
  int year;
  gps.crack_datetime(&year, &tm.Month, &tm.Day, &tm.Hour, &tm.Minute, &tm.Second, NULL, NULL);
  tm.Year = year - 1970; 
  time_t time = makeTime(tm);
  return time + (offset * SECS_PER_HOUR);
}

any suggestions on what could be the problem
thanks in advance

but no luck

...is a bit vague.

Some questions to help you help us help you...

  1. Have you gotten the Parallax receiver working using a simplier Sketch?

  2. Which Parallax reciever are you using?

  3. Have you installed the latest: Arduino IDE, Time library, TinyGPS library, and NewSoftSerial library?

Thank you for reply
Basically when I run the example nothing happens, so assume it is not getting any data from the gps. The gps chip itself is fine I have another sketch where I run it with TinyGPS library and NewSoftSerial library and it works fine.

Put a Serial.println in gpsTimeSync so you can see how often it gets called. My suspicion is that there is some time delay between calls.

I put Serial.println and it was called only once.

So, what does timeStatus() return?

I put Serialprintln(timeStatus())
it returned '0'

According to this:
http://www.arduino.cc/playground/Code/Time
you need to call setTime() once you have the time from the sync provider. I don't see that you call that function.

Looking at the link it is in example for syncing with PC. I want to sync it with GPS. Do I need that? and Where would I call it in my code?

I assumed that running an example that comes with library should be pretty straightforward and work. At least other examples I tried usually did.

setTime() requires a time_t argument, so the output from either of the time functions you have would be good. You could call setTime in gpsTimeSync, before returning the output from gpsTimeToArduinoTime().

I don't have the board with me right now, but I will try it as soon as I get it back. Thanks, I'll let you know if it helped.