I have a datetime field in a Sybase table, and need to use it in Perl for doing some calculations (differences to make sure I'm picking up the records that are at least 'n' mins apart). Now, if I simply do a select <datetime field
>, Sybase returns a human readable field which is no use to me. I was looking at some way to convert this into say, an epoch based time, which will allow me to manipulate them easily in Perl.
I could be wrong but I didn't find an existing function for this in Sybase. The closest I got was datediff, which serves my purpose fine. In fact, I am using that as a workaround for now. The problem with datediff is because of the limitation on integer, it's capped at 68 years. I know my code probably won't be around till that time, but why introduce such a time-based limit on my own?
Is there a way to get around this?
Thanks!
If you're ok with doing it in the client, the Time::ParseDate module should be able to do the work for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With