int sec = milliseconds / 1000

Read more of this post