It does not count as time in service. It is my understanding, though, that if you stay 20 or more years it does get added for retirement purposes. Someone will have to verify that.
It's not counted toward either years of service for pay or for retirement - so unless you were prior service- upon comissioning you will get paid at the O1 under 2 rate with zero years of active duty . If you were to get out of the Navy and go to work for the Fed Government it may be credited as years of Federal service when your total is computed (at least I have been told that it may be credited to you- I have seen different interpretations of that and don't know anyone who has done this).