# Formatting time:: AS2

**URL:** https://forum.kirupa.com/t/formatting-time-as2/244244
**Category:** flash
**Created:** [November 15, 2007, 3:44pm UTC](https://forum.kirupa.com/t/formatting-time-as2/244244 "2007-11-15T15:44:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lilleypants](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@lilleypants](https://forum.kirupa.com/u/lilleypants)
#### Post date: [November 15, 2007, 3:44pm UTC](https://forum.kirupa.com/t/formatting-time-as2/244244/1 "2007-11-15T15:44:09Z")

</div>

I have an game that tells the time the user has spent in the game. This works fine all apart from the formatting of the time.

For example I need the time to be presented like so (H/M/S/MS): 08:24:04:02

Where as instead it looks like this:8:24:4:2

How would I go about formatting the time so that when there is single figures there is a zero placed infront?

Thanks for any help
