This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Human-readable long epoch dates (long meaning those that include milliseconds) | |
function! DateFromLongEpoch() | |
" Let the shell divide because vim only supports 32 bit ints | |
let sdate=system("echo $((". expand("<cword>") ."/1000))") | |
" Format the date | |
let human=tolower(substitute(strftime("%m/%d/%y %I:%M:%S%p", sdate), "\\\<0", "", "g")) | |
return human ." (". (sdate - localtime()) ." seconds from now)" | |
endfunc |