Our company lets us work on opensource libraries in work time. How did this happen: we pushed management to allow opening some of internal code under premise that "someone else will do the same job, opensource it (since it's platform-level stuff that has nothing to do with business), their implementation will become a de-facto standard, and we'll have to rewrite our internal stuff to match the industry standard". That ultimately worked.