Convert value stored in a variable to epoch time?

Hello

I have a the creation date of a file stored in a variable in the following format:

Wed May 06 10:14:58 2009

Is there a way I can echo the variable and display it in epoch time?

I've done a lot of searching on this topic, but haven't managed to get a solution. I'm on Solaris 10.

Thanks
Glyn

  1. do you have perl?
  2. is getting the mtime directly from the file an option? - rather than what you have
    -- in other words before creating your variable.

what gives ?

date -d "Wed May 06 10:14:58 2009" +%s

:eek: OOPS : non GNU date !! Apologizes :eek:
Can't i remove my stupid post ?