sqlite - How to Convert twitter api timestamp to unix time in vba excel -


i trying convert twitter timestamp string unix time (seconds since epoch). have been searching while cant find works. know how convert "mon sep 24 03:35:21 +0000 2012" unix time? or if not, sqlite db time function?

using mon sep 24 03:35:21 +0000 2012 string, returns unix (aka posix) date long.

dim tt string, ut long tt = "mon sep 24 03:35:21 +0000 2012" ut = ((cdate(mid(tt, 5, 6) & ",  " & right(tt, 4) & mid(tt, 11, 9)) + (iif(mid(tt, 21, 1) = chr(45), -1, 1) * timeserial(mid(tt, 22, 2), mid(tt, 24, 2), 0))) - 25569) * 86400 debug.print ut 

the result 1348457721 sample you've provided.

edit:

modified above code account both positive , negative utc timezone offsets.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -