I'm not sure why, but this took me forever to figure out; so I'm posting it here for others...
Let's say you have a string representing a date and a time and you want to convert it to epoch time (# secs since the epoch).
First you will need to create a pattern for your time format, using time format directives.
For example, the pattern for:
Would be:
You can then convert it to epoch like this:
Now in a script:
Copyright © 2006-2008 Corey Goldberg
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.